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

Fix fetching gym application.

parent 5347b26e
No related merge requests found
......@@ -45,29 +45,25 @@ export async function applyToGym({
username,
email,
trainer_name,
description,
trainer_description,
}: GymApplicationSent): Promise<GymApplicationReturned> {
const reqBody = {
gym_name,
username,
gym_id,
email,
trainer_name,
description,
application_description,
gym_name,
username,
gym_id,
email,
trainer_name,
trainer_description,
application_description,
};
const res = (await axios.post(`${config.NODE_JS_API}/api/job/apply`, reqBody, header));
const res = await axios.post(
`${config.NODE_JS_API}/api/job/apply`,
reqBody,
header
);
if (res.status !== 200) {
throw new Error("Failed to apply to gym");
}
const myPromise = new Promise<GymApplicationReturned>(function (myResolve) {
myResolve({
acceptance: 0,
description: application_description,
gymId: gym_id,
gymName: gym_name,
});
});
return myPromise;
return res.data;
}
......@@ -19,6 +19,7 @@ const gymApplicationSentSchema = gymApplicationFetchedSchema
trainer_name: z.string().max(50),
trainer_description: z.string().max(255),
username: z.string().max(50),
email: z.string().email(),
})
.omit({
acceptance: true,
......
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