From f274d3be65534c999f045e8be67789e93169f26e Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Mon, 6 Aug 2018 09:31:50 +0100 Subject: [PATCH] Safety commit Ran out of electricity last night when I'd almost but not quite got creation working properly. Frustrating! I don't have much electricity this morning so I'm pushing this up to GitHub for safety. --- src/adl/to_selmer_routes.clj | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/adl/to_selmer_routes.clj b/src/adl/to_selmer_routes.clj index 34dfad4..fab59df 100644 --- a/src/adl/to_selmer_routes.clj +++ b/src/adl/to_selmer_routes.clj @@ -293,7 +293,7 @@ (list 'support/resolve-template (str (path-part f e a) ".html")) (list 'merge {:title (capitalise (:name (:attrs f))) - :params 'params} + :params (list 'merge (property-defaults e) 'params)} (case (:tag f) :form (make-form-get-handler-content f e a n) :page (make-page-get-handler-content f e a n) @@ -359,7 +359,13 @@ 'result)) (list 'case (:status 'result) 200 {:message "Record stored"} - 201 (str "Record created: " (list :body 'result)) + 201 (list 'try + (list 'merge + (list 'read-string (list :body 'result))) + (list + 'catch 'Exception 'x + {:message (list 'str "Record created: " (list :body 'result)) + :error "Exception while reading returned key"})) {:error (list :body 'result)}))))))