aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-07-24 17:09:37 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-07-24 17:09:37 +0200
commit2c70ae5ce205a48c6d5c0baff3c60f793735f9a6 (patch)
tree1d2c43b849f691230f413944f914332dbdfb800d
parentMove parenthesis. (diff)
downloadcalp-2c70ae5ce205a48c6d5c0baff3c60f793735f9a6.tar.gz
calp-2c70ae5ce205a48c6d5c0baff3c60f793735f9a6.tar.xz
/insert endpoint actually saves the events.
-rw-r--r--module/entry-points/server.scm12
1 files changed, 10 insertions, 2 deletions
diff --git a/module/entry-points/server.scm b/module/entry-points/server.scm
index 706f2699..b7d4afff 100644
--- a/module/entry-points/server.scm
+++ b/module/entry-points/server.scm
@@ -180,11 +180,19 @@
(return (build-response code: 400)
(format #f "~?~%" fmt args)))))
+ ;; NOTE Posibly defer save to a later point.
+ ;; That would allow better asyncronous preformance.
+ ((@ (output vdir) save-event) event)
+
(format (current-error-port)
"Event inserted ~a~%" (prop event 'UID))
- (return '((content-type text/plain))
- "Event inserted\r\n"))))
+ (return '((content-type application/xml))
+ (with-output-to-string
+ (lambda ()
+ (sxml->xml
+ `(properties
+ (uid (text ,(prop event 'UID)))))))))))
;; Get specific page by query string instead of by path.
;; Useful for <form>'s, since they always submit in this form, but also