cafy 5.xに移行
This commit is contained in:
@@ -1,19 +1,15 @@
|
||||
/**
|
||||
* Module dependencies
|
||||
*/
|
||||
import $ from 'cafy';
|
||||
import $ from 'cafy'; import ID from '../../../../cafy-id';
|
||||
import Channel, { IChannel, pack } from '../../../../models/channel';
|
||||
|
||||
/**
|
||||
* Show 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] = $(params.channelId).type(ID).$;
|
||||
if (channelIdErr) return rej('invalid channelId param');
|
||||
|
||||
// Fetch channel
|
||||
|
Reference in New Issue
Block a user