From 1bf0d724139c6192cecd9e7d7a7f3e89c78a6759 Mon Sep 17 00:00:00 2001 From: Melissa Autumn Date: Mon, 16 Sep 2024 09:50:59 -0700 Subject: [PATCH] Show rate limit error on booking page instead of general unknown error. --- backend/src/appointment/routes/schedule.py | 2 +- frontend/src/views/BookingView.vue | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/src/appointment/routes/schedule.py b/backend/src/appointment/routes/schedule.py index 24f654982..df8aa218d 100644 --- a/backend/src/appointment/routes/schedule.py +++ b/backend/src/appointment/routes/schedule.py @@ -181,7 +181,7 @@ def read_schedule_availabilities( @router.put('/public/availability/request') -@limiter.limit("20/minute") +@limiter.limit("0/minute") def request_schedule_availability_slot( request: Request, s_a: schemas.AvailabilitySlotAttendee, diff --git a/frontend/src/views/BookingView.vue b/frontend/src/views/BookingView.vue index 35acd1778..35d0b46e5 100644 --- a/frontend/src/views/BookingView.vue +++ b/frontend/src/views/BookingView.vue @@ -90,6 +90,9 @@ const handleError = (data: Exception) => { if (errorDetail?.id === 'SCHEDULE_NOT_ACTIVE') { errorHeading.value = ''; errorBody.value = errorDetail.message; + } else if (errorDetail.id === 'RATE_LIMIT_EXCEEDED') { + errorHeading.value = ''; + errorBody.value = errorDetail.message; } };