import { NextApiRequest, NextApiResponse } from 'next' import { channelRepo } from '../../channel' import { routeHandler, getBodyKey } from '../../routes' export default routeHandler( (req: NextApiRequest, _res: NextApiResponse): Promise => { const slug = getBodyKey(req, 'slug') return channelRepo.destroy(slug) }, )