diff --git a/route/api/twitch/index.js b/route/api/twitch/index.js index db0e683..a166733 100644 --- a/route/api/twitch/index.js +++ b/route/api/twitch/index.js @@ -67,7 +67,7 @@ r.get('/channel/:chid', checkSession, getChannelList, hasChannel('chid'), async c.obj = resObject('Success', {channel: c.state.channel}) }) -r.put('/channel/:chid/botjoin', checkSession, getChannelList, hasChannel('chid'), async (c, n) => { +r.put('/channel/:chid/botjoin', checkSession, getChannelList, hasChannel('chid'), koaBody(), async (c, n) => { if (!c.chkBody('join', 'number')) throw genError('DataFormat') let join = toInt(c.request.body.join, 0, 0, 1) let text = `update "public"."twitch_channel" set "join" = $1 where "id" = $2` @@ -82,7 +82,7 @@ r.put('/channel/:chid/botjoin', checkSession, getChannelList, hasChannel('chid') c.obj = resObject('Success') }) -r.put('/channel/:chid/opay', checkSession, getChannelList, hasChannel('chid'), async (c, n) => { +r.put('/channel/:chid/opay', checkSession, getChannelList, hasChannel('chid'), koaBody(), async (c, n) => { if (!c.chkBody('opay', 'string', true)) throw genError('DataFormat') let text = `update "public"."twitch_channel" set "opayid" = $1 where "id" = $2`