mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
refactor: use redux
This commit is contained in:
@ -48,11 +48,9 @@ const CreateShortcutDialog: React.FC<Props> = (props: Props) => {
|
||||
|
||||
try {
|
||||
if (shortcutId) {
|
||||
const editedShortcut = await shortcutService.updateShortcut(shortcutId, title, JSON.stringify(filters));
|
||||
shortcutService.editShortcut(shortcutService.convertResponseModelShortcut(editedShortcut));
|
||||
await shortcutService.updateShortcut(shortcutId, title, JSON.stringify(filters));
|
||||
} else {
|
||||
const shortcut = await shortcutService.createShortcut(title, JSON.stringify(filters));
|
||||
shortcutService.pushShortcut(shortcutService.convertResponseModelShortcut(shortcut));
|
||||
await shortcutService.createShortcut(title, JSON.stringify(filters));
|
||||
}
|
||||
} catch (error: any) {
|
||||
toastHelper.error(error.message);
|
||||
|
||||
Reference in New Issue
Block a user