web: EntryProposal form implementation.
This commit is contained in:
@ -126,9 +126,15 @@ proc start*(cfg: HffEntryFormsApiConfig): void =
|
||||
get "/version":
|
||||
jsonResp(Http200, $(%("hff_entry_forms_api v" & HFF_ENTRY_FORMS_API_VERSION)))
|
||||
|
||||
options "/add-page": optionsResp(@[HttpPost])
|
||||
options "/event-proposals/config": optionsResp(@[HttpGet])
|
||||
|
||||
post "/propose-event":
|
||||
get "/event-proposals/config":
|
||||
withApiErrors:
|
||||
dataResp(%getEventProposalConfig(cfg))
|
||||
|
||||
options "/event-proposals": optionsResp(@[HttpPost])
|
||||
|
||||
post "/event-proposals":
|
||||
withApiErrors:
|
||||
let ep = parseEventProposal(parseJson(request.body))
|
||||
if createProposedEvent(cfg, ep): statusResp(Http200)
|
||||
|
Reference in New Issue
Block a user