Remove two unused API helpers that call routes that do not exist #51
Labels
No labels
bug
chore
data
feature
frontend
good first issue
intermediate
needs/docs
needs/research
needs/upstream
type/bug
type/external
type/feature
type/refactor
urgency
high
urgency
immediate
urgency
low
urgency
medium
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ScottyLabs/cal#51
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What's wrong
listGoogleCalendarsrequests/google/calendar/list, but the API route isGET /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
grep -rn "listGoogleCalendars" web/src: only the definition matches.list_calendarsinapi/app/api/google.py(@google_bp.route("/calendars")).Expected
No helper points at a route that does not exist.
Also
removeCategoryFromScheduleinweb/src/app/utils/api/schedules.tscallsDELETE /schedule/category/<id>, which the API does not have. It is imported inweb/src/context/UserContext.tsxbut 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: callsapi.get("/google/calendars")directly./google/calendarsand use it in ConnectGoogleButton. Keep theCalendarFieldstype; ConnectGoogleButton uses it.Done when
npx eslint .andnpx tsc --noEmitpass inweb/.