mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-22 17:15:13 +00:00
perf(server): Reduce database query
This commit is contained in:
parent
c4c20bee7c
commit
a4a9b8707d
1 changed files with 1 additions and 2 deletions
|
@ -53,12 +53,11 @@ export default async (user: User, note: Note, reaction?: string) => {
|
|||
await Notes.createQueryBuilder().update()
|
||||
.set({
|
||||
reactions: () => sql,
|
||||
score: () => '"score" + 1'
|
||||
})
|
||||
.where('id = :id', { id: note.id })
|
||||
.execute();
|
||||
|
||||
Notes.increment({ id: note.id }, 'score', 1);
|
||||
|
||||
perUserReactionsChart.update(user, note);
|
||||
|
||||
// カスタム絵文字リアクションだったら絵文字情報も送る
|
||||
|
|
Loading…
Reference in a new issue