From 6e1a5e962aad5cb3a03aab780ee614083027903e Mon Sep 17 00:00:00 2001
From: unknown <13521043@std.stei.itb.ac.id>
Date: Fri, 17 Nov 2023 13:38:17 +0700
Subject: [PATCH] Update gymApplication.ts

---
 src/utils/api/gymApplication.ts | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/utils/api/gymApplication.ts b/src/utils/api/gymApplication.ts
index 93ec8b6..c317ca8 100644
--- a/src/utils/api/gymApplication.ts
+++ b/src/utils/api/gymApplication.ts
@@ -42,8 +42,21 @@ export async function applyToGym({
   application_description,
   gym_id,
   gym_name,
+  username,
+  email,
+  trainer_name,
+  description,
 }: GymApplicationSent): Promise<GymApplicationReturned> {
-  const res = (await (await axios.post(`${config.NODE_JS_API}/api/job/apply`, header)).data);
+  const reqBody = {
+      gym_name,
+      username,
+      gym_id,
+      email,
+      trainer_name,
+      description,
+      application_description,
+  };
+  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");
   }
-- 
GitLab