Skip to content

Commit

Permalink
Merge pull request #243 from codex-team/recent-note-list
Browse files Browse the repository at this point in the history
Save noteVisit on note creation
  • Loading branch information
e11sy authored Apr 7, 2024
2 parents a75c07e + 08a681a commit 50c0330
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/presentation/http/router/note.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,14 @@ const NoteRouter: FastifyPluginCallback<NoteRouterOptions> = (fastify, opts, don

const addedNote = await noteService.addNote(content as JSON, userId as number, parentId); // "authRequired" policy ensures that userId is not null

/**
* Save note visit when note created
*
* @todo use even bus to save noteVisit
*/

await noteVisitsService.saveVisit(addedNote.id, userId!);

/**
* @todo use event bus: emit 'note-added' event and subscribe to it in other modules like 'note-settings'
*/
Expand Down

0 comments on commit 50c0330

Please sign in to comment.