From 7be2225917b94be0e1232f3604a8479b0c06410c Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Mon, 6 Aug 2018 12:01:54 +0100 Subject: [PATCH] Create and Update now satisfactory for most records Date and Time fields are not yet handled correctly. --- src/adl/to_selmer_routes.clj | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/adl/to_selmer_routes.clj b/src/adl/to_selmer_routes.clj index fab59df..b6bff0b 100644 --- a/src/adl/to_selmer_routes.clj +++ b/src/adl/to_selmer_routes.clj @@ -85,7 +85,8 @@ (symbol "db/*db*") 'params) :message warning - :error-return {:warnings [warning]})))) + :error-return {:warnings [warning]}) + 'params))) (defn compose-get-menu-options @@ -357,14 +358,18 @@ 'merge 'params 'result)) - (list 'case (:status 'result) + (list 'case (list :status 'result) 200 {:message "Record stored"} 201 (list 'try - (list 'merge - (list 'read-string (list :body 'result))) + (list 'hash-map + :params + (list 'merge 'params + (list :body 'result)) + :message + (list 'str "Record created")(list :body 'result)) (list 'catch 'Exception 'x - {:message (list 'str "Record created: " (list :body 'result)) + {:message "Record created" :error "Exception while reading returned key"})) {:error (list :body 'result)}))))))