refac
This commit is contained in:
1 parent
a5c9459401
commit
c7e634776d
2 files changed
+9
-10
No files matched your search
@@ -30,16 +30,19 @@
|
||||
const submitHandler = async () => {
|
||||
loading = true;
|
||||
|
||||
const res = await (edit
|
||||
? updateMemoryById(localStorage.token, memory.id, content, type, path)
|
||||
: addNewMemory(localStorage.token, content, type, path)
|
||||
const res = await (
|
||||
edit
|
||||
? updateMemoryById(localStorage.token, memory.id, content, type, path)
|
||||
: addNewMemory(localStorage.token, content, type, path)
|
||||
).catch((error) => {
|
||||
toast.error(`${error}`);
|
||||
return null;
|
||||
});
|
||||
|
||||
if (res) {
|
||||
toast.success(edit ? $i18n.t('Memory updated successfully') : $i18n.t('Memory added successfully'));
|
||||
toast.success(
|
||||
edit ? $i18n.t('Memory updated successfully') : $i18n.t('Memory added successfully')
|
||||
);
|
||||
show = false;
|
||||
dispatch('save');
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user