Skip to content

Commit

Permalink
Fix: Error ahora se muestra en pantalla para asignar cuando no se ind…
Browse files Browse the repository at this point in the history
…ica asignatario
  • Loading branch information
starg09 committed Oct 10, 2023
1 parent 2e823d6 commit 32e68f8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/components/asignar/asignar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,21 @@ export class AsignarComponent {

validarAsignacion() {
if (!this.asignatario) {
throw { message: 'Debe seleccionar un usuario' }
throw new Error('Debe seleccionar un usuario')
}
}

async asignar() {
this.errors = []
this.validarAsignacion()
try {
this.validarAsignacion()
} catch (error) {
if (error instanceof Error) {
console.error("Error validando asignación: " + error.message)
}
mostrarError(this, error)
return
}
this.tarea.asignarA(this.asignatario)
this.tareasService.actualizarTarea(this.tarea).subscribe({
next: () => { this.navegarAHome() },
Expand Down

0 comments on commit 32e68f8

Please sign in to comment.