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,25 +45,30 @@ 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> {
const response = await api.get(`/gyms/${countryCode}/${cityShortName}/${gymShortName}`);
const d = response.data;
const gym: Gym = {
countryCode: d.countryCode,
countryName: d.countryName,
cityShortName: d.cityShortName,
cityName: d.cityName,
createdAt: new Date(d.createdAt),
shortName: d.shortName,
displayName: d.displayName,
websiteUrl: d.websiteUrl,
location: d.location,
streetAddress: d.streetAddress
};
return gym;
}
export async function getExercises(): Promise<Array<Exercise>> { export async function getExercises(): Promise<Array<Exercise>> {
const response = await api.get(`/exercises`); const response = await api.get(`/exercises`);
return response.data; 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;
return {
countryCode: d.countryCode,
countryName: d.countryName,
cityShortName: d.cityShortName,
cityName: d.cityName,
createdAt: new Date(d.createdAt),
shortName: d.shortName,
displayName: d.displayName,
websiteUrl: d.websiteUrl,
location: d.location,
streetAddress: d.streetAddress,
};
}