diff --git a/src/modules/item/blob/blob.controller.ts b/src/modules/item/blob/blob.controller.ts index 20b9e85..994ca08 100644 --- a/src/modules/item/blob/blob.controller.ts +++ b/src/modules/item/blob/blob.controller.ts @@ -52,7 +52,7 @@ export default class BlobController { const updatedBlob = await this.blobService.updateBlob(request.body); - triggerItemEvent(updatedBlob, ItemEventType.UPDATE); + await triggerItemEvent(updatedBlob, ItemEventType.UPDATE); return reply.code(200).send(updatedBlob); } catch (e) { @@ -105,7 +105,7 @@ export default class BlobController { parentId: tokenPayloadObject.parentId ?? null, }); - triggerItemEvent(createdBlob, ItemEventType.UPDATE); + await triggerItemEvent(createdBlob, ItemEventType.UPDATE); } catch (e) { request.log.error(e); await this.blobService.deleteBlobByUrl(blob.url); @@ -168,7 +168,7 @@ export default class BlobController { await this.blobService.deleteBlobByItemId(blob.id); - triggerItemEvent(blob, ItemEventType.DELETE); + await triggerItemEvent(blob, ItemEventType.DELETE); return reply.code(204).send(); } catch (e) { diff --git a/src/modules/item/docs/docs.controller.ts b/src/modules/item/docs/docs.controller.ts index 4f17da7..492e74b 100644 --- a/src/modules/item/docs/docs.controller.ts +++ b/src/modules/item/docs/docs.controller.ts @@ -52,7 +52,7 @@ export default class DocsController { const updatedDocs = await this.docsService.updateDocs(request.body); - triggerItemEvent(updatedDocs, ItemEventType.UPDATE); + await triggerItemEvent(updatedDocs, ItemEventType.UPDATE); return reply.code(200).send(updatedDocs); } catch (e) { @@ -87,7 +87,7 @@ export default class DocsController { parentId: request.body.parentId ?? null, }); - triggerItemEvent(docs, ItemEventType.UPDATE); + await triggerItemEvent(docs, ItemEventType.UPDATE); return reply.code(200).send(docs); } catch (e) { @@ -111,7 +111,7 @@ export default class DocsController { await this.docsService.deleteDocsByItemId(docs.id); - triggerItemEvent(docs, ItemEventType.DELETE); + await triggerItemEvent(docs, ItemEventType.DELETE); return reply.code(204).send(); } catch (e) { diff --git a/src/modules/item/folder/folder.controller.ts b/src/modules/item/folder/folder.controller.ts index 830a685..fbcb3a8 100644 --- a/src/modules/item/folder/folder.controller.ts +++ b/src/modules/item/folder/folder.controller.ts @@ -60,7 +60,7 @@ export default class FolderController { const updatedFolder = await this.folderService.updateFolder(request.body); - triggerItemEvent(updatedFolder, ItemEventType.UPDATE); + await triggerItemEvent(updatedFolder, ItemEventType.UPDATE); return reply.code(200).send(updatedFolder); } catch (e) { @@ -95,7 +95,7 @@ export default class FolderController { parentId: request.body.parentId ?? null, }); - triggerItemEvent(folder, ItemEventType.UPDATE); + await triggerItemEvent(folder, ItemEventType.UPDATE); return reply.code(200).send(folder); } catch (e) { @@ -119,7 +119,7 @@ export default class FolderController { await this.folderService.deleteFolderByItemId(folder.id); - triggerItemEvent(folder, ItemEventType.DELETE); + await triggerItemEvent(folder, ItemEventType.DELETE); return reply.code(204).send(); } catch (e) { diff --git a/src/modules/item/shortcut/shortcut.controller.ts b/src/modules/item/shortcut/shortcut.controller.ts index 03c3fd5..57d34ff 100644 --- a/src/modules/item/shortcut/shortcut.controller.ts +++ b/src/modules/item/shortcut/shortcut.controller.ts @@ -60,7 +60,7 @@ export default class ShortcutController { const updatedShortcut = await this.shortcutService.updateShortcut(request.body); - triggerItemEvent(updatedShortcut, ItemEventType.UPDATE); + await triggerItemEvent(updatedShortcut, ItemEventType.UPDATE); return reply.code(200).send(updatedShortcut); } catch (e) { @@ -95,7 +95,7 @@ export default class ShortcutController { parentId: request.body.parentId ?? null, }); - triggerItemEvent(shortcut, ItemEventType.UPDATE); + await triggerItemEvent(shortcut, ItemEventType.UPDATE); return reply.code(200).send(shortcut); } catch (e) { @@ -119,7 +119,7 @@ export default class ShortcutController { await this.shortcutService.deleteShortcutByItemId(shortcut.id); - triggerItemEvent(shortcut, ItemEventType.DELETE); + await triggerItemEvent(shortcut, ItemEventType.DELETE); return reply.code(204).send(); } catch (e) {