Fixed another merge.

This commit is contained in:
Andrew Lalis 2023-01-24 22:03:56 +01:00
commit 3ce2d99c22
2 changed files with 23 additions and 19 deletions

View File

@ -41,7 +41,6 @@
<version>1.9.0</version> <version>1.9.0</version>
</dependency> </dependency>
<!-- Test dependencies --> <!-- Test dependencies -->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>

View File

@ -45,10 +45,21 @@ export function getFileUrl(fileId: number) {
return BASE_URL + `/files/${fileId}`; return BASE_URL + `/files/${fileId}`;
} }
export async function getGym(countryCode: string, cityShortName: string, gymShortName: string): Promise<Gym> { export async function getExercises(): Promise<Array<Exercise>> {
const response = await api.get(`/gyms/${countryCode}/${cityShortName}/${gymShortName}`); const response = await api.get(`/exercises`);
return response.data;
}
export async function getGym(
countryCode: string,
cityShortName: string,
gymShortName: string
): Promise<Gym> {
const response = await api.get(
`/gyms/${countryCode}/${cityShortName}/${gymShortName}`
);
const d = response.data; const d = response.data;
const gym: Gym = { return {
countryCode: d.countryCode, countryCode: d.countryCode,
countryName: d.countryName, countryName: d.countryName,
cityShortName: d.cityShortName, cityShortName: d.cityShortName,
@ -58,12 +69,6 @@ export async function getGym(countryCode: string, cityShortName: string, gymShor
displayName: d.displayName, displayName: d.displayName,
websiteUrl: d.websiteUrl, websiteUrl: d.websiteUrl,
location: d.location, location: d.location,
streetAddress: d.streetAddress streetAddress: d.streetAddress,
}; };
return gym;
}
export async function getExercises(): Promise<Array<Exercise>> {
const response = await api.get(`/exercises`);
return response.data;
} }