chore: update redux store and service

This commit is contained in:
boojack
2022-05-22 11:01:20 +08:00
parent c3c2882dc5
commit a580df5c9f
27 changed files with 199 additions and 307 deletions

View File

@ -96,19 +96,11 @@ const ShortcutContainer: React.FC<ShortcutContainerProps> = (props: ShortcutCont
event.stopPropagation();
try {
if (shortcut.rowStatus === "ARCHIVED") {
await shortcutService.unpinShortcut(shortcut.id);
shortcutService.editShortcut({
...shortcut,
rowStatus: "NORMAL",
});
} else {
await shortcutService.pinShortcut(shortcut.id);
shortcutService.editShortcut({
...shortcut,
rowStatus: "ARCHIVED",
});
}
const shortcutPatch: ShortcutPatch = {
id: shortcut.id,
rowStatus: shortcut.rowStatus === "ARCHIVED" ? "NORMAL" : "ARCHIVED",
};
await shortcutService.patchShortcut(shortcutPatch);
} catch (error) {
// do nth
}