interim commit with lots of stuff

- conversion from Element UI to Bootstrap 4 in progress (smaller, more
flexible)
- added Font Awesome for fonts, vue-toast for notifications
- added common components to main.js and out of other components
- some work on pulling answered requests (#3), added icon for notes (#8)
This commit is contained in:
Daniel J. Summers
2017-09-28 21:59:40 -05:00
parent 1e1afa9d89
commit ef88964cd0
19 changed files with 244 additions and 165 deletions

View File

@@ -68,6 +68,17 @@ export default function (pool) {
})
},
/**
* Get all answered requests with their text as of the "Answered" status
* @param {string} userId The Id of the user for whom requests should be retrieved
* @return All requests
*/
answered: async (userId) =>
(await pool.query(`${currentRequestSql}
WHERE "userId" = $1
AND "lastStatus" = 'Answered'
ORDER BY "asOf" DESC`)).rows,
/**
* Get the "current" version of a request by its Id
* @param {string} requestId The Id of the request to retrieve

View File

@@ -45,7 +45,10 @@ export default function (checkJwt) {
ctx.body = await db.request.oldest(ctx.state.user.sub)
await next()
})
.get('/answered', checkJwt, async (ctx, next) => {
ctx.body = await db.request.answered(ctx.state.user.sub)
await next()
})
return router
}