First cut of answered requests

- changed import to only bring in church rather than the entire lodash
package
- changed webpack config to exclude moment's locale
- set the bearer token on load if the user is authenticated
This commit is contained in:
Daniel J. Summers
2017-09-30 16:12:14 -05:00
parent 834eaf2416
commit e0d27a708d
8 changed files with 41 additions and 11 deletions

View File

@@ -77,7 +77,8 @@ export default function (pool) {
(await pool.query(`${currentRequestSql}
WHERE "userId" = $1
AND "lastStatus" = 'Answered'
ORDER BY "asOf" DESC`)).rows,
ORDER BY "asOf" DESC`,
[ userId ])).rows,
/**
* Get the "current" version of a request by its Id

View File

@@ -47,6 +47,7 @@ export default function (checkJwt) {
})
.get('/answered', checkJwt, async (ctx, next) => {
ctx.body = await db.request.answered(ctx.state.user.sub)
ctx.response.status = 200
await next()
})