From 24d13054a93554ae6fb99eb9986d6af356b2dc11 Mon Sep 17 00:00:00 2001 From: Anand Suthar Date: Mon, 17 Jun 2024 22:50:59 +0530 Subject: [PATCH] Extracted profile updating logic --- lib/patient/updateProfilePicture.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 lib/patient/updateProfilePicture.tsx diff --git a/lib/patient/updateProfilePicture.tsx b/lib/patient/updateProfilePicture.tsx new file mode 100644 index 00000000..46011d00 --- /dev/null +++ b/lib/patient/updateProfilePicture.tsx @@ -0,0 +1,12 @@ +async function updateProfilePicture(profile_url: string) { + const res = await fetch("/api/patient/update-profile/profile", { + method: "PUT", + body: JSON.stringify(profile_url), + }); + + const isProfileUpdated = await res.json(); + + return isProfileUpdated; +} + +export default updateProfilePicture;