From c249cd62cf6d11fabbc2b6126f45a7bac45bd093 Mon Sep 17 00:00:00 2001 From: Amarnath AS Date: Sun, 10 Mar 2024 02:46:37 +0530 Subject: [PATCH 1/9] feat: admin user mangement service --- client/src/Services/userService.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/client/src/Services/userService.js b/client/src/Services/userService.js index e69de29..a68d726 100644 --- a/client/src/Services/userService.js +++ b/client/src/Services/userService.js @@ -0,0 +1,29 @@ +import thaliaAPI from "../API/thaliaAPI"; + +export const getUsers = async () => { + try { + const response = await thaliaAPI.get("/admin/users", { withCredentials: true }); + return response.data; + } catch (error) { + return error; + } +} + +export const blockUser = async (userId) => { + try { + const response = await thaliaAPI.put(`/admin/users/block/${userId}`, { withCredentials: true }); + return response.data; + } catch (error) { + return error; + } +} + +export const unBlockUser = async (userId) => { + try { + const response = await thaliaAPI.put(`/admin/users/unblock/${userId}`, { withCredentials: true }); + return response.data; + } catch (error) { + return error; + } +} + From bc80cfbd1692e0cfa80b5da0b3500d5015486d8f Mon Sep 17 00:00:00 2001 From: Amarnath AS Date: Sun, 10 Mar 2024 02:48:22 +0530 Subject: [PATCH 2/9] feat: admin Add body management --- client/src/components/AddBody/AddBody.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/components/AddBody/AddBody.jsx b/client/src/components/AddBody/AddBody.jsx index bd9c9f6..760184f 100644 --- a/client/src/components/AddBody/AddBody.jsx +++ b/client/src/components/AddBody/AddBody.jsx @@ -40,7 +40,7 @@ function AddBody({ openModal, setOpenModal }) {

Name of the Topic

- - - From ab589e9cc0fb3865495b79632eaa2fad141ea19f Mon Sep 17 00:00:00 2001 From: Amarnath AS Date: Sun, 10 Mar 2024 02:58:53 +0530 Subject: [PATCH 9/9] fix: admin my body page update --- client/src/pages/AdminPages/MyBody/MyBody.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/pages/AdminPages/MyBody/MyBody.jsx b/client/src/pages/AdminPages/MyBody/MyBody.jsx index f870ed8..afdd993 100644 --- a/client/src/pages/AdminPages/MyBody/MyBody.jsx +++ b/client/src/pages/AdminPages/MyBody/MyBody.jsx @@ -56,7 +56,7 @@ function MyBody() { bodyDetails={editBody ? editBody : null} /> -
+
{/* Text Components */}