@@ -33,10 +33,11 @@ type ChannelsApi = Post '[JSON] [NamedChannel UserId] :<|>
33 "get" :> ReqBody '[JSON] NamedChannelRequest :> Post '[JSON] PostResponse :<|>
33 "get" :> ReqBody '[JSON] NamedChannelRequest :> Post '[JSON] PostResponse :<|>
34 "getAnonymous" :> ReqBody '[JSON] (LimitingRequest AnonymousChannel) :> Post '[JSON] PostResponse :<|>
34 "getAnonymous" :> ReqBody '[JSON] (LimitingRequest AnonymousChannel) :> Post '[JSON] PostResponse :<|>
35 "create" :> ReqBody '[JSON] NamedChannelCreationRequest :> Post '[JSON] NamedChannelId :<|>
35 "create" :> ReqBody '[JSON] NamedChannelCreationRequest :> Post '[JSON] NamedChannelId :<|>
36− "update" :> ReqBody '[JSON] (NamedChannel UserId) :> PostNoContent '[JSON, FormUrlEncoded, PlainText] NoContent
36+ "update" :> ReqBody '[JSON] (NamedChannel UserId) :> PostNoContent '[JSON, FormUrlEncoded, PlainText] NoContent :<|>
37+ "delete" :> ReqBody '[JSON] NamedChannelId :> PostNoContent '[JSON, FormUrlEncoded, PlainText] NoContent
38channelsApi :: UserId -> ServerT ChannelsApi App
39channelsApi :: UserId -> ServerT ChannelsApi App
39−channelsApi uId = getChannelsApi uId :<|> getChannel uId :<|> getAnonymousChannelsApi :<|> createChannelApi uId :<|> updateChannelApi uId
40+channelsApi uId = getChannelsApi uId :<|> getChannel uId :<|> getAnonymousChannelsApi :<|> createChannelApi uId :<|> updateChannelApi uId :<|> deleteChannelApi uId
42getChannelsApi :: UserId -> App [NamedChannel UserId]
43getChannelsApi :: UserId -> App [NamedChannel UserId]
@@ -54,4 +55,9 @@ createChannelApi uId req = maybeNotFound . runQnotFound $ createNewChannel uId r
54updateChannelApi :: UserId -> NamedChannel UserId -> App NoContent
55updateChannelApi :: UserId -> NamedChannel UserId -> App NoContent
55updateChannelApi uId req = do
56updateChannelApi uId req = do
56 runQnotFound $ updateChannel uId req
57 runQnotFound $ updateChannel uId req
60+deleteChannelApi :: UserId -> NamedChannelId -> App NoContent
61+deleteChannelApi uId cId = do
62+ runQnotFound $ deleteNamedChannel uId cId
57 return NoContent
63 return NoContent