Skip to content
Snippets Groups Projects
Commit 0364ac65 authored by Fatih20's avatar Fatih20
Browse files

Make mock gym API.

parent d6a9fec5
No related merge requests found
public/gym/1.jpg

22.5 KiB

File added
......@@ -4,7 +4,35 @@ import { header } from ".";
import { GymReturned } from "../validationSchema/gym";
export async function getGym(): Promise<GymReturned[]> {
return (await axios.get(`${config.NODE_JS_API}/api/gym/`, header)).data;
// return (await axios.get(`${config.NODE_JS_API}/api/gym/`, header)).data;
const myPromise = new Promise<GymReturned[]>(function (myResolve) {
myResolve([
{
averageRating: 5,
cityId: 1,
cityName: "Bruh City",
description: "dfklcdmfklm",
id: 2,
monthlyPrice: 5000,
name: "Bruh",
pictureId: 1,
videoId: 1,
},
{
averageRating: 5,
cityId: 2,
cityName: "Bruh City",
description: "dfklcdmfklm",
id: 1,
monthlyPrice: 5000,
name: "Bruh2",
pictureId: 1,
videoId: 1,
},
]);
});
return myPromise;
}
export async function getGymById({
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment