diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-07-08 02:15:40 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2020-07-08 02:15:40 +0200 |
commit | 2e0c177d40419c92a93a45eb7efd136341ec52cc (patch) | |
tree | 00c524d8b02aba959567d568591bc739d832cde8 /module/entry-points/server.scm | |
parent | Add xcal class to unformatted xml. (diff) | |
download | calp-2e0c177d40419c92a93a45eb7efd136341ec52cc.tar.gz calp-2e0c177d40419c92a93a45eb7efd136341ec52cc.tar.xz |
Add /remove POST endpoint.
Diffstat (limited to 'module/entry-points/server.scm')
-rw-r--r-- | module/entry-points/server.scm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/module/entry-points/server.scm b/module/entry-points/server.scm index a0afa0f8..0698daf0 100644 --- a/module/entry-points/server.scm +++ b/module/entry-points/server.scm @@ -105,6 +105,18 @@ intervaltype: 'month )))))) + + (POST "/remove" (uid) + (unless uid + (return (build-response code: 400) + "uid required")) + + (aif (get-event-by-uid uid) + (begin (remove-event it) + (return (build-response code: 204) "")) + (return (build-response code: 400) + (format #f "No event with UID '~a'" uid)))) + ;; TODO this fails when dtstart is <date>. (POST "/insert" (cal data) |