@@ -309,8 +309,7 @@ getAllUsers :: StaticPQ [User]
309309getAllUsers = runQuery getAllUsersQ >>= getRows
310310
311311publishPost :: UserId -> PostCreation -> StaticPQ PostId
312−-- publishPost uId pc = transactionally_ $ do
313−publishPost uId pc = do
312+publishPost uId pc = commitedTransactionallyUpdate $ do
314313 pId' <- manipulateParams createPostRowQ (uId, postCreationTags pc) >>= firstRow
315314 case pId' of
316315 (Just (Only pId)) -> do
@@ -319,15 +318,13 @@ publishPost uId pc = do
319318 _ -> lift $ S.throwError S.err404
320319
321320createNewChannel :: UserId -> NamedChannelCreationRequest -> StaticPQ (Maybe NamedChannelId)
322−-- createNewChannel uId req = transactionally_ $ do
323−createNewChannel uId req = do
321+createNewChannel uId req = commitedTransactionallyUpdate $ do
324322 uIds <- verifiedUsers . toList $ namedChannelCreationRequestPeopleIds req
325323 cId <- manipulateParams createNamedChannelQ (addUserToChannelCreate uId (req {namedChannelCreationRequestPeopleIds = fromList uIds})) >>= firstRow
326324 return $ fmap fromOnly cId
327325
328326updateChannel :: UserId -> NamedChannel UserId -> StaticPQ ()
329−-- updateChannel uId req = transactionally_ $ do
330−updateChannel uId req = do
327+updateChannel uId req = commitedTransactionallyUpdate $ do
331328 uIds <- fmap fromList . verifiedUsers . toList $ namedChannelPeopleIds req
332329 _ <- getChannelForUser uId $ namedChannelId req
333330 _ <- manipulateParams updateNamedChannelQ $ addUserToChannelUpdate uId (req {namedChannelPeopleIds = uIds})
@@ -350,8 +347,7 @@ getAllChannels uId = fmap (map removeUserFromChannel) $
350347 runQueryParams getAllChannelsForUserQ (Only uId) >>= getRows
351348
352349deleteNamedChannel :: UserId -> NamedChannelId -> StaticPQ ()
353−-- deleteNamedChannel uId cId = transactionally_ $ do
354−deleteNamedChannel uId cId = do
350+deleteNamedChannel uId cId = commitedTransactionallyUpdate $ do
355351 _ <- getChannelForUser uId cId
356352 _ <- manipulateParams deleteNamedChannelQ (Only cId)
357353 return ()