Skip to content

Commit

Permalink
feat: add redirect to admin/panel after send register organizer form
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandro-velasquez committed Nov 13, 2024
1 parent be9a178 commit 96dfb2b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
10 changes: 1 addition & 9 deletions app/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ public function registerOrganizer(){

public function storeOrganizer(Request $request)
{

// Validar los datos del formulario
$validated = $request->validate([
'document' => 'nullable|string',
Expand All @@ -188,15 +189,6 @@ public function storeOrganizer(Request $request)
'document_type' => $validated['document_type'] ?? $user->document_type,
'document_image_path' => $documentImagePath,
]);

if (!$user->hasRole('organizador')) {
$user->assignRole('organizador');
}

return response()->json([
'message' => 'Información del organizador actualizada exitosamente.',
'document_image_url' => Storage::url($documentImagePath),
], 200);
}

return response()->json([
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Pages/Users/RegisterOrganizer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export default {
'Content-Type': 'multipart/form-data',
},
});
alert(response.data.message);
window.location.href = '/admin/panel';
} catch (error) {
errors.value = error.response?.data?.errors || {};
} finally {
Expand Down

0 comments on commit 96dfb2b

Please sign in to comment.