Repo collaborator removal
This commit is contained in:
parent
d655e7302e
commit
40add444ba
1 changed files with 19 additions and 2 deletions
|
@ -231,7 +231,24 @@ getRepoDevR :: ShrIdent -> RpIdent -> ShrIdent -> Handler Html
|
|||
getRepoDevR shr rp dev = error "Not implemented"
|
||||
|
||||
deleteRepoDevR :: ShrIdent -> RpIdent -> ShrIdent -> Handler Html
|
||||
deleteRepoDevR shr rp dev = error "Not implemented"
|
||||
deleteRepoDevR shr rp dev = do
|
||||
runDB $ do
|
||||
rid <- do
|
||||
Entity s _ <- getBy404 $ UniqueSharer shr
|
||||
Entity r _ <- getBy404 $ UniqueRepo rp s
|
||||
return r
|
||||
pid <- do
|
||||
Entity s _ <- getBy404 $ UniqueSharer dev
|
||||
Entity p _ <- getBy404 $ UniquePersonIdent s
|
||||
return p
|
||||
Entity cid _collab <- getBy404 $ UniqueCollab rid pid
|
||||
delete cid
|
||||
setMessage "Collaborator removed."
|
||||
redirect $ RepoDevsR shr rp
|
||||
|
||||
postRepoDevR :: ShrIdent -> RpIdent -> ShrIdent -> Handler Html
|
||||
postRepoDevR shr rp dev = error "Not implemented"
|
||||
postRepoDevR shr rp dev = do
|
||||
mmethod <- lookupPostParam "_method"
|
||||
case mmethod of
|
||||
Just "DELETE" -> deleteRepoDevR shr rp dev
|
||||
_ -> notFound
|
||||
|
|
Loading…
Reference in a new issue