Raymond Wiker rwiker@gmail.com writes:
On Feb 9, 2013, at 21:53 , Jim Barrows jim.barrows@gmail.com wrote:
Unfortunately,. the JQuery sortable api is the on that determines the names of the fields, and not me. Thanks for the help though! It is greatly appreciated!
You may be able to use something like the following (untested):
(hunchentoot:define-easy-handler (task-prioritize-url-handler :uri *task-prioritize*) () (let ((tasks (mapcar #'cdr (remove-if-not (lambda (x) (string= (car x) "task[]")) (hunchentoot:get-parameters*))))) (task-prioritize tasks)))
If your request use "POST", you may have to replace get-parameters* with post-parameters*, or possibly to have both combined with append.
Not really relevant to the problem, just some "protips":
(remove-if-not (lambda (x) (string= (car x) "task[]")) (hunchentoot:get-parameters*)) => (remove "task[]" (hunchentoot:get-parameters*) :key #'car :test #'string/=)
But with mapcar #'cdr combined, it'd be better: (loop for (key . value) in (get-parameters*) when (string= key "task[]") collect value)