mirror of
https://code.sup39.dev/repos/Wqawg
synced 2024-12-28 23:14:51 +09:00
Add group member related dummy routes
This commit is contained in:
parent
3687687457
commit
16d33da4de
2 changed files with 28 additions and 2 deletions
|
@ -42,7 +42,9 @@
|
||||||
/g GroupsR GET POST
|
/g GroupsR GET POST
|
||||||
/g/!new GroupNewR GET
|
/g/!new GroupNewR GET
|
||||||
/g/#ShrIdent GroupR GET
|
/g/#ShrIdent GroupR GET
|
||||||
/g/#ShrIdent/m GroupMembersR GET
|
/g/#ShrIdent/m GroupMembersR GET POST
|
||||||
|
/g/#ShrIdent/m/!new GroupMemberNewR GET
|
||||||
|
/g/#ShrIdent/m/#ShrIdent GroupMemberR GET DELETE POST
|
||||||
|
|
||||||
/k KeysR GET POST
|
/k KeysR GET POST
|
||||||
/k/!new KeyNewR GET
|
/k/!new KeyNewR GET
|
||||||
|
|
|
@ -19,6 +19,11 @@ module Vervis.Handler.Group
|
||||||
, getGroupNewR
|
, getGroupNewR
|
||||||
, getGroupR
|
, getGroupR
|
||||||
, getGroupMembersR
|
, getGroupMembersR
|
||||||
|
, postGroupMembersR
|
||||||
|
, getGroupMemberNewR
|
||||||
|
, getGroupMemberR
|
||||||
|
, deleteGroupMemberR
|
||||||
|
, postGroupMemberR
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
|
|
||||||
|
@ -31,7 +36,7 @@ import Database.Esqueleto
|
||||||
import Text.Blaze.Html (Html)
|
import Text.Blaze.Html (Html)
|
||||||
import Yesod.Auth (requireAuthId)
|
import Yesod.Auth (requireAuthId)
|
||||||
import Yesod.Core (defaultLayout, setMessage)
|
import Yesod.Core (defaultLayout, setMessage)
|
||||||
import Yesod.Core.Handler (redirect)
|
import Yesod.Core.Handler (redirect, lookupPostParam, notFound)
|
||||||
import Yesod.Form.Functions (runFormPost)
|
import Yesod.Form.Functions (runFormPost)
|
||||||
import Yesod.Form.Types (FormResult (..))
|
import Yesod.Form.Types (FormResult (..))
|
||||||
import Yesod.Persist.Core (runDB, getBy404)
|
import Yesod.Persist.Core (runDB, getBy404)
|
||||||
|
@ -115,3 +120,22 @@ getGroupMembersR shar = do
|
||||||
return sharer
|
return sharer
|
||||||
return (s, ms)
|
return (s, ms)
|
||||||
defaultLayout $(widgetFile "group/members")
|
defaultLayout $(widgetFile "group/members")
|
||||||
|
|
||||||
|
postGroupMembersR :: ShrIdent -> Handler Html
|
||||||
|
postGroupMembersR shar = error "Not implemented"
|
||||||
|
|
||||||
|
getGroupMemberNewR :: ShrIdent -> Handler Html
|
||||||
|
getGroupMemberNewR shar = error "Not implemented"
|
||||||
|
|
||||||
|
getGroupMemberR :: ShrIdent -> ShrIdent -> Handler Html
|
||||||
|
getGroupMemberR grp memb = error "Not implemented"
|
||||||
|
|
||||||
|
deleteGroupMemberR :: ShrIdent -> ShrIdent -> Handler Html
|
||||||
|
deleteGroupMemberR grp memb = error "Not implemented"
|
||||||
|
|
||||||
|
postGroupMemberR :: ShrIdent -> ShrIdent -> Handler Html
|
||||||
|
postGroupMemberR grp memb = do
|
||||||
|
mmethod <- lookupPostParam "_method"
|
||||||
|
case mmethod of
|
||||||
|
Just "DELETE" -> deleteGroupMemberR grp memb
|
||||||
|
_ -> notFound
|
||||||
|
|
Loading…
Reference in a new issue