@@ -309,7 +309,8 @@ getAllUsers :: StaticPQ [User]
309getAllUsers = runQuery getAllUsersQ >>= getRows
309getAllUsers = runQuery getAllUsersQ >>= getRows
311publishPost :: UserId -> PostCreation -> StaticPQ PostId
311publishPost :: UserId -> PostCreation -> StaticPQ PostId
312−publishPost uId pc = transactionally_ $ do
312+-- publishPost uId pc = transactionally_ $ do
313+publishPost uId pc = do
313 pId' <- manipulateParams createPostRowQ (uId, postCreationTags pc) >>= firstRow
314 pId' <- manipulateParams createPostRowQ (uId, postCreationTags pc) >>= firstRow
314 case pId' of
315 case pId' of
315 (Just (Only pId)) -> do
316 (Just (Only pId)) -> do
@@ -318,12 +319,14 @@ publishPost uId pc = transactionally_ $ do
318 _ -> lift $ S.throwError S.err404
319 _ -> lift $ S.throwError S.err404
320createNewChannel :: UserId -> NamedChannelCreationRequest -> StaticPQ (Maybe NamedChannelId)
321createNewChannel :: UserId -> NamedChannelCreationRequest -> StaticPQ (Maybe NamedChannelId)
321−createNewChannel uId req = transactionally_ $ do
322+-- createNewChannel uId req = transactionally_ $ do
323+createNewChannel uId req = do
322 uIds <- verifiedUsers . toList $ namedChannelCreationRequestPeopleIds req
324 uIds <- verifiedUsers . toList $ namedChannelCreationRequestPeopleIds req
323 cId <- manipulateParams createNamedChannelQ (addUserToChannelCreate uId (req {namedChannelCreationRequestPeopleIds = fromList uIds})) >>= firstRow
325 cId <- manipulateParams createNamedChannelQ (addUserToChannelCreate uId (req {namedChannelCreationRequestPeopleIds = fromList uIds})) >>= firstRow
324 return $ fmap fromOnly cId
326 return $ fmap fromOnly cId
326updateChannel :: UserId -> NamedChannel UserId -> StaticPQ ()
328updateChannel :: UserId -> NamedChannel UserId -> StaticPQ ()
329+-- updateChannel uId req = transactionally_ $ do
327updateChannel uId req = do
330updateChannel uId req = do
328 uIds <- fmap fromList . verifiedUsers . toList $ namedChannelPeopleIds req
331 uIds <- fmap fromList . verifiedUsers . toList $ namedChannelPeopleIds req
329 _ <- getChannelForUser uId $ namedChannelId req
332 _ <- getChannelForUser uId $ namedChannelId req
@@ -347,8 +350,9 @@ getAllChannels uId = fmap (map removeUserFromChannel) $
347 runQueryParams getAllChannelsForUserQ (Only uId) >>= getRows
350 runQueryParams getAllChannelsForUserQ (Only uId) >>= getRows
349deleteNamedChannel :: UserId -> NamedChannelId -> StaticPQ ()
352deleteNamedChannel :: UserId -> NamedChannelId -> StaticPQ ()
350−deleteNamedChannel uId cId = transactionally_ $ do
353+-- deleteNamedChannel uId cId = transactionally_ $ do
354+deleteNamedChannel uId cId = do
351− _ <- getChannelForUser uId cId
355+ _ <- getChannelForUser uId cId
352 _ <- manipulateParams deleteNamedChannelQ (Only cId)
356 _ <- manipulateParams deleteNamedChannelQ (Only cId)
353 return ()
357 return ()