Remove two unused API helpers that call routes that do not exist #51

Open
opened 2026-10-03 19:44:40 +00:00 by jalenluorion · 0 comments
Member

What's wrong
listGoogleCalendars requests /google/calendar/list, but the API route is GET /google/calendars, so it would always fail. Nothing calls it today, so users see no error, but the next person to use it will hit a 404.

How to reproduce

  1. Run grep -rn "listGoogleCalendars" web/src: only the definition matches.
  2. Compare its path with list_calendars in api/app/api/google.py (@google_bp.route("/calendars")).

Expected
No helper points at a route that does not exist.

Also
removeCategoryFromSchedule in web/src/app/utils/api/schedules.ts calls DELETE /schedule/category/<id>, which the API does not have. It is imported in web/src/context/UserContext.tsx but never called. Remove it and the import too.

Where to look

  • web/src/app/utils/api/googleCalendar.ts: listGoogleCalendars.
  • web/src/app/components/ConnectGoogleButton.tsx: calls api.get("/google/calendars") directly.
  • Either delete the helper, or fix its path to /google/calendars and use it in ConnectGoogleButton. Keep the CalendarFields type; ConnectGoogleButton uses it.

Done when

  • The helper is deleted, or fixed and used by ConnectGoogleButton.
  • Connecting Google Calendar and choosing calendars still works.
  • npx eslint . and npx tsc --noEmit pass in web/.
**What's wrong** `listGoogleCalendars` requests `/google/calendar/list`, but the API route is `GET /google/calendars`, so it would always fail. Nothing calls it today, so users see no error, but the next person to use it will hit a 404. **How to reproduce** 1. Run `grep -rn "listGoogleCalendars" web/src`: only the definition matches. 2. Compare its path with `list_calendars` in `api/app/api/google.py` (`@google_bp.route("/calendars")`). **Expected** No helper points at a route that does not exist. **Also** `removeCategoryFromSchedule` in `web/src/app/utils/api/schedules.ts` calls `DELETE /schedule/category/<id>`, which the API does not have. It is imported in `web/src/context/UserContext.tsx` but never called. Remove it and the import too. **Where to look** - `web/src/app/utils/api/googleCalendar.ts`: `listGoogleCalendars`. - `web/src/app/components/ConnectGoogleButton.tsx`: calls `api.get("/google/calendars")` directly. - Either delete the helper, or fix its path to `/google/calendars` and use it in ConnectGoogleButton. Keep the `CalendarFields` type; ConnectGoogleButton uses it. **Done when** - [ ] The helper is deleted, or fixed and used by ConnectGoogleButton. - [ ] Connecting Google Calendar and choosing calendars still works. - [ ] `npx eslint .` and `npx tsc --noEmit` pass in `web/`.
jalenluorion added this to the Phase 1 milestone 2026-10-03 19:44:40 +00:00
jalenluorion added this to the CMUCal project 2026-10-03 19:45:09 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ScottyLabs/cal#51
No description provided.