diff --git a/be/app/Http/Resources/SubTaskResource.php b/be/app/Http/Resources/SubTaskResource.php index 1e0439b..1a363f9 100644 --- a/be/app/Http/Resources/SubTaskResource.php +++ b/be/app/Http/Resources/SubTaskResource.php @@ -32,7 +32,7 @@ class SubTaskResource extends JsonResource 'is_finished' => $this->is_finished, 'timeblocks' => TimeblockResource::collection($this->timeblocks), 'timesheets' => TimesheetResource::collection($this->timesheets), - 'files' => AttachmentResource::collection($this->attachments ?: $this->mastertask->attachments), + 'files' => AttachmentResource::collection(($this->attachments->isNotEmpty()) ?: $this->mastertask->attachments), 'color' => $this->mastertask->color, ];