@@ -33,10 +33,11 @@ type ChannelsApi = Post '[JSON] [NamedChannel UserId] :<|>
3333 "get" :> ReqBody '[JSON] NamedChannelRequest :> Post '[JSON] PostResponse :<|>
3434 "getAnonymous" :> ReqBody '[JSON] (LimitingRequest AnonymousChannel) :> Post '[JSON] PostResponse :<|>
3535 "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
3738
3839channelsApi :: 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
4041
4142
4243getChannelsApi :: UserId -> App [NamedChannel UserId]
@@ -54,4 +55,9 @@ createChannelApi uId req = maybeNotFound . runQnotFound $ createNewChannel uId r
5455updateChannelApi :: UserId -> NamedChannel UserId -> App NoContent
5556updateChannelApi uId req = do
5657 runQnotFound $ updateChannel uId req
58+ return NoContent
59+
60+deleteChannelApi :: UserId -> NamedChannelId -> App NoContent
61+deleteChannelApi uId cId = do
62+ runQnotFound $ deleteNamedChannel uId cId
5763 return NoContent