diff --git a/be/app/Http/Controllers/SubTaskController.php b/be/app/Http/Controllers/SubTaskController.php index 35fc9e8..c286bb8 100644 --- a/be/app/Http/Controllers/SubTaskController.php +++ b/be/app/Http/Controllers/SubTaskController.php @@ -178,7 +178,7 @@ class SubTaskController extends Controller foreach ( $request->all()['data']['employees'] as $key => $employee ) { if (!isset($data['data']['employees'][$key]['timeblocks']) || $data['data']['employees'][$key]['timeblocks'] == null) continue; - + if ($data['data']['employees'][$key]['user_id'] == $employee['id']) $subtasks[$key]->syncTimeblocks($data['data']['employees'][$key]['timeblocks']); } @@ -250,6 +250,13 @@ class SubTaskController extends Controller $subtask->update($request->all()['data']); + // upload attachmentu + if ($request->file('data')) { + $attachments = Attachment::uploadAttachmentsToS3($request->file('data')['files'], $subtask->mastertask); + + $subtask->attachments()->createMany($attachments); + } + // syncnutie vykazu $subtask->syncTimesheets($data['data']['timesheets']);