refactor: renamed API dirs

This commit is contained in:
2024-02-08 13:27:28 +01:00
parent 8703decb91
commit 3bd487d126
3 changed files with 2 additions and 2 deletions

View File

@@ -10,13 +10,13 @@ export interface HomePageProps {
} }
const fetchAllLocations = async (year: number) => { const fetchAllLocations = async (year: number) => {
const response = await fetch(`/api/all-locations/?year=${year}`); const response = await fetch(`/api/locations/in-year/?year=${year}`);
const { locations } : { locations: WithId<BillingLocation>[] } = await response.json(); const { locations } : { locations: WithId<BillingLocation>[] } = await response.json();
return locations; return locations;
} }
const fetchAvailableYears = async () => { const fetchAvailableYears = async () => {
const response = await fetch(`/api/available-years/`); const response = await fetch(`/api/locations/available-years/`);
const { availableYears }: { availableYears: number[]} = await response.json(); const { availableYears }: { availableYears: number[]} = await response.json();
return availableYears; return availableYears;
} }