summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/channels/unwatch.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/api/endpoints/channels/unwatch.ts')
-rw-r--r--src/server/api/endpoints/channels/unwatch.ts8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/server/api/endpoints/channels/unwatch.ts b/src/server/api/endpoints/channels/unwatch.ts
index 8220b90b68..f7dddff461 100644
--- a/src/server/api/endpoints/channels/unwatch.ts
+++ b/src/server/api/endpoints/channels/unwatch.ts
@@ -1,20 +1,16 @@
/**
* Module dependencies
*/
-import $ from 'cafy';
+import $ from 'cafy'; import ID from '../../../../cafy-id';
import Channel from '../../../../models/channel';
import Watching from '../../../../models/channel-watching';
/**
* Unwatch a channel
- *
- * @param {any} params
- * @param {any} user
- * @return {Promise<any>}
*/
module.exports = (params, user) => new Promise(async (res, rej) => {
// Get 'channelId' parameter
- const [channelId, channelIdErr] = $(params.channelId).id().$;
+ const [channelId, channelIdErr] = $.type(ID).get(params.channelId);
if (channelIdErr) return rej('invalid channelId param');
//#region Fetch channel