From 2c70ae5ce205a48c6d5c0baff3c60f793735f9a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Fri, 24 Jul 2020 17:09:37 +0200 Subject: /insert endpoint actually saves the events. --- module/entry-points/server.scm | 12 ++++++++++-- 1 file 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
's, since they always submit in this form, but also -- cgit v1.2.3