diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-03-29 14:48:47 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-03-29 14:48:47 +0900 |
| commit | bfc193d8cd9aecdb82d585e8b4e101deac60a5bb (patch) | |
| tree | 8b4dac3a56cf703650c8207f9279028a8560a96b /src/server/api/endpoints/posts/reactions/delete.ts | |
| parent | resolve conflict (diff) | |
| download | sharkey-bfc193d8cd9aecdb82d585e8b4e101deac60a5bb.tar.gz sharkey-bfc193d8cd9aecdb82d585e8b4e101deac60a5bb.tar.bz2 sharkey-bfc193d8cd9aecdb82d585e8b4e101deac60a5bb.zip | |
Resolve conflicts
Diffstat (limited to 'src/server/api/endpoints/posts/reactions/delete.ts')
| -rw-r--r-- | src/server/api/endpoints/posts/reactions/delete.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/server/api/endpoints/posts/reactions/delete.ts b/src/server/api/endpoints/posts/reactions/delete.ts index 922c57ab18..b09bcbb4b7 100644 --- a/src/server/api/endpoints/posts/reactions/delete.ts +++ b/src/server/api/endpoints/posts/reactions/delete.ts @@ -14,9 +14,9 @@ import Post from '../../../models/post'; * @return {Promise<any>} */ module.exports = (params, user) => new Promise(async (res, rej) => { - // Get 'post_id' parameter - const [postId, postIdErr] = $(params.post_id).id().$; - if (postIdErr) return rej('invalid post_id param'); + // Get 'postId' parameter + const [postId, postIdErr] = $(params.postId).id().$; + if (postIdErr) return rej('invalid postId param'); // Fetch unreactee const post = await Post.findOne({ @@ -29,9 +29,9 @@ module.exports = (params, user) => new Promise(async (res, rej) => { // if already unreacted const exist = await Reaction.findOne({ - post_id: post._id, - user_id: user._id, - deleted_at: { $exists: false } + postId: post._id, + userId: user._id, + deletedAt: { $exists: false } }); if (exist === null) { @@ -43,7 +43,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => { _id: exist._id }, { $set: { - deleted_at: new Date() + deletedAt: new Date() } }); @@ -51,7 +51,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => { res(); const dec = {}; - dec[`reaction_counts.${exist.reaction}`] = -1; + dec[`reactionCounts.${exist.reaction}`] = -1; // Decrement reactions count Post.update({ _id: post._id }, { |