mirror of https://github.com/kern/filepizza
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.
11 lines
387 B
TypeScript
11 lines
387 B
TypeScript
import { NextApiRequest, NextApiResponse } from 'next'
|
|
import { Channel, channelRepo } from '../../channel'
|
|
import { routeHandler, getBodyKey } from '../../routes'
|
|
|
|
export default routeHandler<Channel>(
|
|
(req: NextApiRequest, _res: NextApiResponse): Promise<Channel> => {
|
|
const uploaderPeerID = getBodyKey(req, 'uploaderPeerID')
|
|
return channelRepo.create(uploaderPeerID)
|
|
},
|
|
)
|