summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/channels/unwatch.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-03-29 14:48:47 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-03-29 14:48:47 +0900
commitbfc193d8cd9aecdb82d585e8b4e101deac60a5bb (patch)
tree8b4dac3a56cf703650c8207f9279028a8560a96b /src/server/api/endpoints/channels/unwatch.ts
parentresolve conflict (diff)
downloadmisskey-bfc193d8cd9aecdb82d585e8b4e101deac60a5bb.tar.gz
misskey-bfc193d8cd9aecdb82d585e8b4e101deac60a5bb.tar.bz2
misskey-bfc193d8cd9aecdb82d585e8b4e101deac60a5bb.zip
Resolve conflicts
Diffstat (limited to 'src/server/api/endpoints/channels/unwatch.ts')
-rw-r--r--src/server/api/endpoints/channels/unwatch.ts16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/server/api/endpoints/channels/unwatch.ts b/src/server/api/endpoints/channels/unwatch.ts
index 19d3be118a..709313bc6e 100644
--- a/src/server/api/endpoints/channels/unwatch.ts
+++ b/src/server/api/endpoints/channels/unwatch.ts
@@ -13,9 +13,9 @@ import Watching from '../../models/channel-watching';
* @return {Promise<any>}
*/
module.exports = (params, user) => new Promise(async (res, rej) => {
- // Get 'channel_id' parameter
- const [channelId, channelIdErr] = $(params.channel_id).id().$;
- if (channelIdErr) return rej('invalid channel_id param');
+ // Get 'channelId' parameter
+ const [channelId, channelIdErr] = $(params.channelId).id().$;
+ if (channelIdErr) return rej('invalid channelId param');
//#region Fetch channel
const channel = await Channel.findOne({
@@ -29,9 +29,9 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
//#region Check whether not watching
const exist = await Watching.findOne({
- user_id: user._id,
- channel_id: channel._id,
- deleted_at: { $exists: false }
+ userId: user._id,
+ channelId: channel._id,
+ deletedAt: { $exists: false }
});
if (exist === null) {
@@ -44,7 +44,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
_id: exist._id
}, {
$set: {
- deleted_at: new Date()
+ deletedAt: new Date()
}
});
@@ -54,7 +54,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => {
// Decrement watching count
Channel.update(channel._id, {
$inc: {
- watching_count: -1
+ watchingCount: -1
}
});
});