diff options
author | Samuel <34555296+Flam3rboy@users.noreply.github.com> | 2023-03-18 04:13:04 +0100 |
---|---|---|
committer | Samuel <34555296+Flam3rboy@users.noreply.github.com> | 2023-03-18 04:13:04 +0100 |
commit | 7b00e9905327c826b82fc47cfa22e37b9c5161a9 (patch) | |
tree | 5a9458701dacc77bf8c6265ebf96035bf0b93e5f /src/api/routes/users/@me | |
parent | fix: missing id in select query (diff) | |
download | server-7b00e9905327c826b82fc47cfa22e37b9c5161a9.tar.xz |
fix: use entity.save() instead of insert (needed for caching)
Diffstat (limited to 'src/api/routes/users/@me')
-rw-r--r-- | src/api/routes/users/@me/notes.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/api/routes/users/@me/notes.ts b/src/api/routes/users/@me/notes.ts index 64730c1a..f82c3ca1 100644 --- a/src/api/routes/users/@me/notes.ts +++ b/src/api/routes/users/@me/notes.ts @@ -52,17 +52,17 @@ router.put("/:id", route({}), async (req: Request, res: Response) => { where: { owner: { id: owner.id }, target: { id: target.id } }, }) ) { - Note.update( + await Note.update( { owner: { id: owner.id }, target: { id: target.id } }, { owner, target, content: note }, ); } else { - Note.insert({ + await Note.create({ id: Snowflake.generate(), owner, target, content: note, - }); + }).save(); } } else { await Note.delete({ |