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.
This commit is contained in:
Simon Brooke 2018-08-06 09:31:50 +01:00
parent c1d1bf59e8
commit f274d3be65

View file

@ -293,7 +293,7 @@
(list 'support/resolve-template (str (path-part f e a) ".html")) (list 'support/resolve-template (str (path-part f e a) ".html"))
(list 'merge (list 'merge
{:title (capitalise (:name (:attrs f))) {:title (capitalise (:name (:attrs f)))
:params 'params} :params (list 'merge (property-defaults e) 'params)}
(case (:tag f) (case (:tag f)
:form (make-form-get-handler-content f e a n) :form (make-form-get-handler-content f e a n)
:page (make-page-get-handler-content f e a n) :page (make-page-get-handler-content f e a n)
@ -359,7 +359,13 @@
'result)) 'result))
(list 'case (:status 'result) (list 'case (:status 'result)
200 {:message "Record stored"} 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)})))))) {:error (list :body 'result)}))))))