Commit 47cdfcbb authored by Omar Luna Hernández's avatar Omar Luna Hernández
Browse files

Se mejora el mensaje de error

parent 5c348a81
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ export class PointOfInterestService {
      .andWhere('pointTrad.directions IS NULL')
      .getRawMany();
    if (points.length > 0) {
      throw new BadRequestException('El ultimo punto ha sido registrad');
      throw new BadRequestException('El ultimo punto ha sido registrado. Para agregar más, cambia el último punto');
    }

    const createPointDto: CreatePointDto = {
+1 −4
Original line number Diff line number Diff line
@@ -159,14 +159,11 @@ export const usePointOfInterest = (
        if (axios.isAxiosError(error)) {
          error as AxiosError;
          switch (error.code) {
            case axios.AxiosError.ERR_BAD_REQUEST:
              setErrorMessage("Acceso no autorizado");
              break;
            case axios.AxiosError.ERR_NETWORK:
              setErrorMessage("Conexión con el servidor fallida");
              break;
            default:
              setErrorMessage(error.message);
              setErrorMessage(error.response?.data.message);
              break;
          }
        }