fix: make project template inheritance granular and safe
This commit is contained in:
@@ -47,11 +47,7 @@ class CreateProjectTicket
|
||||
$nextSequenceNumber = (int) Ticket::query()
|
||||
->where('project_id', $project->id)
|
||||
->max('sequence_number') + 1;
|
||||
$ticketStatusQuery = TicketStatus::query()
|
||||
->where(
|
||||
$project->project_template_id === null ? 'project_id' : 'project_template_id',
|
||||
$project->project_template_id ?? $project->id,
|
||||
);
|
||||
$ticketStatusQuery = TicketStatus::query()->where('project_id', $project->id);
|
||||
|
||||
$ticketStatus = $ticketStatusQuery->findOrFail(Arr::get($attributes, 'ticket_status_id'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user