Implement featured note API
This commit is contained in:
parent
407467a236
commit
380f5a972c
4 changed files with 65 additions and 8 deletions
|
|
@ -36,12 +36,12 @@ export default async (user: IUser, note: INote, reaction: string) => new Promise
|
|||
|
||||
res();
|
||||
|
||||
const inc: {[key: string]: number} = {};
|
||||
inc[`reactionCounts.${reaction}`] = 1;
|
||||
|
||||
// Increment reactions count
|
||||
await Note.update({ _id: note._id }, {
|
||||
$inc: inc
|
||||
$inc: {
|
||||
[`reactionCounts.${reaction}`]: 1,
|
||||
score: 1
|
||||
}
|
||||
});
|
||||
|
||||
perUserReactionsChart.update(user, note);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue