From 56aa9d904c5b358d7e91edbd3845bd3e90f90970 Mon Sep 17 00:00:00 2001 From: Marcus Kammer Date: Sun, 2 Jun 2024 19:54:08 +0200 Subject: [PATCH] Replace function calls by make-survey --- src/handlers/questionnaire.lisp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/handlers/questionnaire.lisp b/src/handlers/questionnaire.lisp index 3c0572f..70c9b8f 100644 --- a/src/handlers/questionnaire.lisp +++ b/src/handlers/questionnaire.lisp @@ -2,11 +2,12 @@ (defun questionnaire-uri-p (uri) "Check if the request URI matches the pattern '/survey/'" - (let ((parts (split-uri uri))) + (let ((parts (split-uri uri)) + (survey (make-survey uri))) (and (= (length parts) 3) (string= (first parts) "survey") (every #'digit-char-p (second parts)) - (survey-id-p (parse-integer (second parts)))))) + (funcall survey 'id-p)))) (defun questionnaire-uri (request) (questionnaire-uri-p (request-uri request))) @@ -19,6 +20,6 @@ (t (error "Unsupported language: ~A" lang)))) (define-easy-handler (questionnaire :uri #'questionnaire-uri) (lang) - (let ((survey-id (survey-id (request-uri*)))) + (let ((survey (make-survey (request-uri*)))) (setf *html-lang* lang) - (funcall (return-sus-form lang) survey-id))) + (funcall (return-sus-form lang) (funcall survey 'id))))