fix: module_id al cancelar tag dañado
This commit is contained in:
parent
69727724d3
commit
e4419f1a50
@ -301,9 +301,10 @@ public function cancelarTagNoAsignado(Request $request)
|
||||
// Cargar las relaciones necesarias ANTES de usarlas
|
||||
$cancellationLog->load(['cancellationReason', 'cancelledBy']);
|
||||
|
||||
// Actualizar el módulo del tag si se proporciona
|
||||
if ($request->filled('module_id')) {
|
||||
$tag->module_id = $request->module_id;
|
||||
// Actualizar el módulo del tag: usar el enviado o el del usuario autenticado
|
||||
$moduleId = $request->filled('module_id') ? $request->module_id : Auth::user()->module_id;
|
||||
if ($moduleId) {
|
||||
$tag->module_id = $moduleId;
|
||||
$tag->save();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user