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