bug in save content

This commit is contained in:
David Botton 2022-05-16 19:37:49 -04:00
parent 75d3762677
commit bf41f07abb

View file

@ -338,16 +338,17 @@ and if CAN-EDIT unless they are set to nil."
(funcall theme obj :content-body (funcall theme obj :content-body
(list :content content (list :content content
:save-edit (when (clog-auth:is-authorized-p roles can-edit) :save-edit (when (clog-auth:is-authorized-p roles can-edit)
(lambda (content) (lambda (new-content)
(when on-edit (when on-edit
(setf content (funcall on-edit content))) (setf new-content (funcall on-edit new-content)))
(when content (when new-content
(dbi:do-sql (dbi:do-sql
sql-connection sql-connection
(sql-update table (sql-update table
content new-content
"key=? and createdate=?") "key=? and createdate=?")
(list page (getf content :|createdate|)))))) (list page (getf content :|createdate|)))
(print (getf content :|createdate|)))))
:do-delete (when (clog-auth:is-authorized-p roles can-edit) :do-delete (when (clog-auth:is-authorized-p roles can-edit)
(lambda () (lambda ()
(if on-delete (if on-delete