Some fixes to make-survey
This commit is contained in:
parent
56aa9d904c
commit
0fa55fa629
1 changed files with 3 additions and 3 deletions
|
@ -34,14 +34,14 @@
|
||||||
(case action
|
(case action
|
||||||
(id (second (split-uri uri)))
|
(id (second (split-uri uri)))
|
||||||
(id-p (let ((ids (mapcar #'car (load-response (make-surveys-db-path)))))
|
(id-p (let ((ids (mapcar #'car (load-response (make-surveys-db-path)))))
|
||||||
(if (member (survey-fn 'id) ids) t nil)))
|
(if (member (parse-integer (survey-fn 'id)) ids) t nil)))
|
||||||
(uri-p (let ((parts (split-uri uri)))
|
(uri-p (let ((parts (split-uri uri)))
|
||||||
(and (= (length parts) 2)
|
(and (= (length parts) 2)
|
||||||
(string= (first parts) "survey")
|
(string= (first parts) "survey")
|
||||||
(every #'digit-char-p (second parts))
|
(every #'digit-char-p (second parts))
|
||||||
(survey-fn 'id-p))))
|
(survey-fn 'id-p))))
|
||||||
(properties (let ((survey-id (parse-integer (survey-fn 'id))))
|
(properties (first (rest (assoc (parse-integer (survey-fn 'id))
|
||||||
(first (rest (assoc survey-id (load-response (make-surveys-db-path))))))))))
|
(load-response (make-surveys-db-path)))))))))
|
||||||
#'survey-fn))
|
#'survey-fn))
|
||||||
|
|
||||||
(define-easy-handler (survey :uri #'survey-uri) ()
|
(define-easy-handler (survey :uri #'survey-uri) ()
|
||||||
|
|
Loading…
Add table
Reference in a new issue