Browse Source

integrate Meilisearch into edit keywords functionality (web.lisp).

stable
Craig Oates 2 years ago
parent
commit
f38e0aef42
  1. 37
      src/web.lisp

37
src/web.lisp

@ -1270,22 +1270,33 @@
(utils:set-alert "Keywords not provided. Not updated." (utils:set-alert "Keywords not provided. Not updated."
"missing-data") "missing-data")
(redirect "/user/archive")) (redirect "/user/archive"))
((null (nera:get-archive-entry :slug archive-slug)) ((null (nera:get-archive-entry :slug archive-slug))
(utils:set-alert "Cannot file archive entry. Keywords not updated." (utils:set-alert
"invalid-data") "Cannot file archive entry. Keywords not updated."
"invalid-data")
(redirect "/user/archive")) (redirect "/user/archive"))
(t (let ((archive-entry (nera:get-archive-entry :slug archive-slug))
(t (nera:update-archive-entry-property (keywords (utils:format-keywords new-keywords)))
:slug archive-slug (nera:update-archive-entry-property
:property 'archive::keywords-of :slug archive-slug
:value (utils:format-keywords new-keywords)) :property 'archive::keywords-of
;; Integrate updating Meilisearch here. :value keywords)
(utils:set-alert "Archive entry updated." "success") (search:submit-entry
(redirect (format nil "/edit/archive/~a" archive-slug)))) (search:build-payload
(archive::search-id-of archive-entry)
(archive::title-of archive-entry)
(format nil "view/archive/~a"
(archive::slug-of archive-entry))
(format nil "storage/thumb/archive/~a"
(archive::slug-of archive-entry))
(mito.dao.mixin:object-created-at archive-entry)
keywords))
(utils:set-alert "Archive entry updated." "success")
(redirect (format nil "/edit/archive/~a" archive-slug)))))
;; Not Authorised ;; Not Authorised
(progn (utils:set-alert "You are not authorised to delete this archive entry." (progn (utils:set-alert
"error") "You are not authorised to delete this archive entry."
"error")
(redirect "/login"))))))) (redirect "/login")))))))
(defroute ("/edit/archive" :method :POST) () (defroute ("/edit/archive" :method :POST) ()

Loading…
Cancel
Save