From a7c282ca348c1e8e60559e5c064caee28ba11eec Mon Sep 17 00:00:00 2001
From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>
Date: Wed, 9 Oct 2024 16:34:12 +0300
Subject: refactor: so much shit

---
 frontend/src/api/User.tsx | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 frontend/src/api/User.tsx

(limited to 'frontend/src/api/User.tsx')

diff --git a/frontend/src/api/User.tsx b/frontend/src/api/User.tsx
new file mode 100644
index 0000000..c4d1944
--- /dev/null
+++ b/frontend/src/api/User.tsx
@@ -0,0 +1,25 @@
+import axios from "axios";
+import { url } from "./Api";
+import { UserProfile } from "../types/Profile";
+
+export const get_user = async (user_id: string): Promise<UserProfile> => {
+  const response = await axios.get(url(`users/${user_id}`));
+  return response.data.data;
+};
+
+export const get_profile = async (token: string): Promise<UserProfile> => {
+  const response = await axios.get(url(`profile`), {
+    headers: {
+      "Authorization": token,
+    }
+  });
+  return response.data.data;
+};
+
+export const post_profile = async (token: string) => {
+  const _ = await axios.post(url(`profile`), {}, {
+    headers: {
+      "Authorization": token,
+    }
+  });
+};
-- 
cgit v1.2.3

