Active request page (#16)

Also:
- refactored snoozed and answered list pages to use a common list format
- reworked the URLs to make them more consistent
- eliminated current "full" API endpoint, and renamed existing "complete" endpoint to "full"
This commit is contained in:
Daniel J. Summers
2018-08-17 22:12:14 -05:00
parent d3aff4a110
commit e351fe5b56
16 changed files with 261 additions and 245 deletions

View File

@@ -26,7 +26,7 @@ module Error =
/// Handle 404s from the API, sending known URL paths to the Vue app so that they can be handled there
let notFound : HttpHandler =
fun next ctx ->
[ "/answered"; "/journal"; "/legal"; "/request"; "/snoozed"; "/user" ]
[ "/journal"; "/legal"; "/request"; "/user" ]
|> List.filter ctx.Request.Path.Value.StartsWith
|> List.length
|> function
@@ -236,16 +236,6 @@ module Request =
| None -> return! Error.notFound next ctx
}
/// GET /api/request/[req-id]/complete
let getComplete reqId : HttpHandler =
authorize
>=> fun next ctx ->
task {
match! (db ctx).TryCompleteRequestById reqId (userId ctx) with
| Some req -> return! json req next ctx
| None -> return! Error.notFound next ctx
}
/// GET /api/request/[req-id]/full
let getFull reqId : HttpHandler =
authorize