Ticket 1076 : Fix ticket Sync labels

This commit is contained in:
Jérémy Munsch 2022-09-29 13:02:18 +02:00
parent 0f3fc52866
commit fd049309f3
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC
2 changed files with 5 additions and 3 deletions

View file

@ -264,9 +264,8 @@ class TicketController extends Controller
$ticket->file2 = ToolboxHelper::storeImage($ticket->getTable(), $fileTicket2);
}
if ($request->labels) {
$ticket->labels()->sync($request->labels);
}
$ticket->labels()->sync($request->labels);
$ticket->site()->associate($site);
$ticket->saveOrFail();

View file

@ -40,6 +40,9 @@ class StoreTicket extends FormRequest
]);
}
}
$this->merge([
'labels' => $this->labels ?? []
]);
}