Fix parent ticket assignment and display
This commit is contained in:
@@ -4,8 +4,10 @@ namespace App\Actions\Projects;
|
||||
|
||||
use App\Http\Resources\ProjectResource;
|
||||
use App\Http\Resources\TicketPriorityResource;
|
||||
use App\Http\Resources\TicketReferenceResource;
|
||||
use App\Http\Resources\TicketStatusResource;
|
||||
use App\Http\Resources\TicketTypeResource;
|
||||
use App\Models\Ticket;
|
||||
use App\Http\Resources\UserResource;
|
||||
use App\Models\Project;
|
||||
use App\Models\User;
|
||||
@@ -26,6 +28,13 @@ class BuildProjectTicketOptionsPayload
|
||||
|
||||
return [
|
||||
'defaultTicketStatusId' => $defaultTicketStatus?->id,
|
||||
'parentTicketOptions' => TicketReferenceResource::collection(
|
||||
Ticket::query()
|
||||
->where('project_id', $project->id)
|
||||
->whereHas('ticketType', fn ($query) => $query->where('is_parent', true))
|
||||
->orderByDesc('sequence_number')
|
||||
->get(),
|
||||
)->resolve(),
|
||||
'project' => ProjectResource::make($project)->resolve(),
|
||||
'source' => $source,
|
||||
'status' => $status,
|
||||
|
||||
@@ -30,6 +30,7 @@ class CreateProjectTicket
|
||||
* }>,
|
||||
* assignee_user_id?: int|null,
|
||||
* description: string|null,
|
||||
* parent_ticket_id?: int|null,
|
||||
* story_points?: int|null,
|
||||
* ticket_priority_id: int,
|
||||
* ticket_status_id: int,
|
||||
@@ -54,6 +55,7 @@ class CreateProjectTicket
|
||||
'assignee_user_id' => Arr::get($attributes, 'assignee_user_id'),
|
||||
'author_user_id' => $actor?->id,
|
||||
'description' => Arr::get($attributes, 'description'),
|
||||
'parent_ticket_id' => Arr::get($attributes, 'parent_ticket_id'),
|
||||
'project_id' => $project->id,
|
||||
'sequence_number' => $nextSequenceNumber,
|
||||
'ticket_key' => "{$project->key}-{$nextSequenceNumber}",
|
||||
|
||||
Reference in New Issue
Block a user