diff --git a/src/Vervis/Federation/Ticket.hs b/src/Vervis/Federation/Ticket.hs index 79d0994..e1a0755 100644 --- a/src/Vervis/Federation/Ticket.hs +++ b/src/Vervis/Federation/Ticket.hs @@ -788,7 +788,7 @@ insertRemoteTicket -> TextPandocMarkdown -> RemoteActivityId -> OutboxItemId - -> ReaderT SqlBackend m (Either Bool ()) + -> ReaderT SqlBackend m (Either Bool TicketId) insertRemoteTicket mktxl author luTicket published summary content source ractidCreate obiidAccept = do tid <- insert Ticket { ticketNumber = Nothing @@ -840,7 +840,7 @@ insertRemoteTicket mktxl author luTicket published summary content source ractid delete tclid delete tid return $ Left True - Just _rtid -> return $ Right () + Just _rtid -> return $ Right tid insertAcceptOnCreate collections outboxItemRoute actorRoute author luCreate tlocal obiidAccept = do encodeRouteLocal <- getEncodeRouteLocal @@ -919,7 +919,7 @@ projectCreateTicketF now shrRecip prjRecip author body mfwd luCreate ticket muTa let makeTPL tclid = TicketProjectLocal tclid jid result <- insertRemoteTicket makeTPL author (AP.ticketId tlocal) published title desc src ractid obiidAccept unless (isRight result) $ delete obiidAccept - for result $ \ () -> do + for result $ \ _tid -> do mremotesHttpFwd <- for mfwd $ \ (localRecips, sig) -> do let sieve = makeRecipientSet @@ -982,7 +982,7 @@ repoCreateTicketF repoCreateTicketF now shrRecip rpRecip author body mfwd luCreate ticket muTarget = do ParsedCreateTicket targetAndContext tlocal published title desc src <- checkCreateTicket author ticket muTarget - mmhttp <- for (targetRelevance targetAndContext) $ \ (mb, vcs, _diff) -> runDBExcept $ do + mmhttp <- for (targetRelevance targetAndContext) $ \ (mb, vcs, diff) -> runDBExcept $ do Entity rid r <- lift $ do sid <- getKeyBy404 $ UniqueSharer shrRecip getBy404 $ UniqueRepo rpRecip sid @@ -993,7 +993,8 @@ repoCreateTicketF now shrRecip rpRecip author body mfwd luCreate ticket muTarget let mkTRL tclid = TicketRepoLocal tclid rid mb result <- insertRemoteTicket mkTRL author (AP.ticketId tlocal) published title desc src ractid obiidAccept unless (isRight result) $ delete obiidAccept - for result $ \ () -> do + for result $ \ tid -> do + insert_ $ Patch tid published diff mremotesHttpFwd <- for mfwd $ \ (localRecips, sig) -> do let sieve = makeRecipientSet