diff --git a/gymboard-api/pom.xml b/gymboard-api/pom.xml index 8693f15..ab7503e 100644 --- a/gymboard-api/pom.xml +++ b/gymboard-api/pom.xml @@ -41,7 +41,6 @@ 1.9.0 - org.springframework.boot diff --git a/gymboard-app/src/api/gymboard-api.ts b/gymboard-app/src/api/gymboard-api.ts index 5af27b7..0600573 100644 --- a/gymboard-app/src/api/gymboard-api.ts +++ b/gymboard-app/src/api/gymboard-api.ts @@ -45,25 +45,30 @@ export function getFileUrl(fileId: number) { return BASE_URL + `/files/${fileId}`; } -export async function getGym(countryCode: string, cityShortName: string, gymShortName: string): Promise { - 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> { const response = await api.get(`/exercises`); return response.data; } + +export async function getGym( + countryCode: string, + cityShortName: string, + gymShortName: string +): Promise { + 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, + }; +}