album now gets updated mith media
This commit is contained in:
parent
b718e0ba08
commit
781b1cb3db
1 changed files with 6 additions and 2 deletions
|
@ -38,15 +38,19 @@ postUploadR = do
|
||||||
case result of
|
case result of
|
||||||
FormSuccess temp -> do
|
FormSuccess temp -> do
|
||||||
path <- writeOnDrive (tempMediumFile temp) userId (tempMediumAlbum temp)
|
path <- writeOnDrive (tempMediumFile temp) userId (tempMediumAlbum temp)
|
||||||
|
inAlbumId <- return $ tempMediumAlbum temp
|
||||||
medium <- return $ Medium
|
medium <- return $ Medium
|
||||||
(tempMediumTitle temp)
|
(tempMediumTitle temp)
|
||||||
path
|
('/' : path)
|
||||||
(tempMediumTime temp)
|
(tempMediumTime temp)
|
||||||
(tempMediumOwner temp)
|
(tempMediumOwner temp)
|
||||||
(tempMediumDesc temp)
|
(tempMediumDesc temp)
|
||||||
(tempMediumTags temp)
|
(tempMediumTags temp)
|
||||||
(tempMediumAlbum temp)
|
inAlbumId
|
||||||
mId <- runDB $ I.insert medium
|
mId <- runDB $ I.insert medium
|
||||||
|
inAlbum <- runDB $ getJust inAlbumId
|
||||||
|
newMediaList <- return $ mId : (albumContent inAlbum)
|
||||||
|
runDB $ update inAlbumId [AlbumContent =. newMediaList]
|
||||||
setMessage "Image succesfully uploaded"
|
setMessage "Image succesfully uploaded"
|
||||||
redirect $ HomeR
|
redirect $ HomeR
|
||||||
_ -> do
|
_ -> do
|
||||||
|
|
Loading…
Reference in a new issue