mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
fix draft only created for user who creates them
This commit is contained in:
1 parent
584f708076
commit
604dc4f988
4 files changed
+178
-15
No files matched your search
@@ -15,7 +15,7 @@ class SubTaskResource extends JsonResource
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
$data = [
|
||||
'id' => $this->id,
|
||||
'is_draft' => $this->is_draft,
|
||||
'type' => $this->type,
|
||||
@@ -40,5 +40,12 @@ class SubTaskResource extends JsonResource
|
||||
'files' => AttachmentResource::collection($this->attachments->isNotEmpty() ? $this->attachments : $this->mastertask->attachments),
|
||||
'color' => $this->mastertask->color,
|
||||
];
|
||||
|
||||
// Pre drafty pridáme employees dáta
|
||||
if ($this->is_draft && $this->draft_data) {
|
||||
$data['employees'] = $this->draft_data;
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user