Guard directional ticket link writes

This commit is contained in:
2026-05-24 09:53:46 +00:00
parent f6f9d7b066
commit da0054a269
2 changed files with 66 additions and 0 deletions
@@ -29,6 +29,12 @@ class StoreProjectTicketLink
->findOrFail($linkedTicketId);
return DB::transaction(function () use ($linkedTicket, $user, $ticketLinkTypeId, $ticket): TicketLink {
Ticket::query()
->whereKey([$ticket->id, $linkedTicket->id])
->orderBy('id')
->lockForUpdate()
->get(['id']);
$ticketLink = TicketLink::query()
->where(function ($query) use ($ticket, $linkedTicket): void {
$query