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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user