no message

This commit is contained in:
StudioTem committed 2024-02-06 15:01:15 +01:00
1 parent 804a4b76e8
commit 450379dd24
1 file changed
+6 -4
@@ -174,6 +174,12 @@ class SubTaskController extends Controller
$mastertask = MasterTask::find($mastertask_id);
$subtasks = $mastertask->subtasks()->createMany($request->all()['data']['employees']);
// syncnutie timeblocks
foreach ( $request->all()['data']['employees'] as $key => $employee ) {
if ($data['data']['employees'][$key]['user_id'] == $employee['id'])
$subtasks[$key]->syncTimeblocks($data['data']['employees'][$key]['timeblocks']);
}
// upload attachmentu
if ($request->file('data')) {
$attachments = Attachment::uploadAttachmentsToS3($request->file('data')['files'], $mastertask);
@@ -184,10 +190,6 @@ class SubTaskController extends Controller
if ($request->file('data')) {
$subtask->attachments()->createMany($attachments);
}
// syncnutie timeblocks
if ($data['data']['user_id'] == $subtask->user_id)
$subtask->syncTimeblocks($data['data']['timeblocks']);
}
return response()->json([