Adding request works (mostly)

Everything works except adding the new request back to the list; this
proof of concept is a go, and will be merged to master
This commit is contained in:
Daniel J. Summers
2017-09-21 18:45:06 -05:00
parent 794a365f08
commit 015645aa86
14 changed files with 179 additions and 55 deletions

View File

@@ -8,8 +8,7 @@ const router = new Router()
export default function (checkJwt) {
router.post('/', checkJwt, async (ctx, next) => {
const newId = await db.request.addNew(ctx.state.user.sub, ctx.body.requestText)
ctx.body = { id: newId }
ctx.body = await db.request.addNew(ctx.state.user.sub, ctx.request.body.requestText)
await next()
})