From e90de5e31a7aa4a4bc1935345c51a1d1e2495652 Mon Sep 17 00:00:00 2001 From: Craig Oates Date: Mon, 10 Oct 2022 17:12:31 +0100 Subject: [PATCH] add 'Search' as hard-coded URL in '/' and update delete Arch. Entry. The re-direct to /search when the user has set /search as the site's home page is part of a list of other hard-coded re-directs in this site's '/' defroute. The site now deletes the Archive Entry from the Meilisearch database alongside the files in the /storage directory and the nera database. --- src/web.lisp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/web.lisp b/src/web.lisp index f897359..0e270f5 100644 --- a/src/web.lisp +++ b/src/web.lisp @@ -43,6 +43,8 @@ (redirect "/login")) ((string= "pages" (site-settings::home-page-of (nera:get-site-settings))) (redirect "/pages")) + ((string= "search" (site-settings::home-page-of (nera:get-site-settings))) + (redirect "/search")) ((string= "sign-up" (site-settings::home-page-of (nera:get-site-settings))) (redirect "/sign-up")) (t (render #P"index.html" @@ -1331,18 +1333,23 @@ (null (nera:get-archive-entry :slug slug))) (utils:set-alert "Couldn't find archive entry in database. Deleted files only." "invalid-data") - ;; The thumbnail in not know because it was linked to the - ;; text file via the database. You will need to delete the - ;; thumbnail manually at this point but the system has - ;; already failed here anyway so the extra work was already - ;; needed. + ;; The thumbnail in not know about here because it was + ;; linked to the text file via the database. You will need + ;; to delete the thumbnail manually at this point but the + ;; system has already failed here anyway so the extra work + ;; was already needed. (storage:remove-file "" "archive" slug) (redirect "/user/archive")) - (t (storage:remove-file "" "archive" slug) + (t (storage:remove-file "" "archive" slug) ; Archive Entry + ;; Archive Entry Thumbnail (storage:remove-file - "" "archive" - (archive::thumbnail-slug-of (nera:get-archive-entry :slug slug))) + "" "archive" (archive::thumbnail-slug-of + (nera:get-archive-entry :slug slug))) + ;; Meilisearch DB Entry + (search:delete-entry + (archive::search-id-of (nera:get-archive-entry :slug slug))) + ;; DB Entry (nera:delete-archive-entry :slug slug) (utils:set-alert "Archive entry deleted." "success") (redirect "/user/archive")))