From bf3a8c1a0b06a48f507fa2620fa2cd6bfea6b6c6 Mon Sep 17 00:00:00 2001 From: nek0 Date: Sun, 7 Sep 2014 09:23:12 +0200 Subject: [PATCH] remove forgotten references --- Handler/AlbumSettings.hs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Handler/AlbumSettings.hs b/Handler/AlbumSettings.hs index 6480eeb..e3592fa 100644 --- a/Handler/AlbumSettings.hs +++ b/Handler/AlbumSettings.hs @@ -128,9 +128,17 @@ postAlbumDeleteR albumId = do confirm <- lookupPostParam "confirm" case confirm of Just "confirm" -> do + -- remove album reference from user + albumList <- return $ userAlbums owner + newAlbumList <- return $ removeItem albumId albumList + runDB $ update ownerId [UserAlbums =. newAlbumList] + -- delete album content mapM (\a -> runDB $ delete a) (albumContent album) + -- delete album runDB $ delete albumId + -- delete files liftIO $ removeDirectoryRecursive $ "static" "data" (T.unpack $ extractKey userId) (T.unpack $ extractKey albumId) + -- outro setMessage "Album deleted succesfully" redirect $ HomeR _ -> do