You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
filepizza/src/pages/api/destroy.ts

11 lines
343 B
TypeScript

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