diff --git a/modules/ProfilePageModules/sections/DetailProfile.tsx b/modules/ProfilePageModules/sections/DetailProfile.tsx index 972a943..7fd0ded 100644 --- a/modules/ProfilePageModules/sections/DetailProfile.tsx +++ b/modules/ProfilePageModules/sections/DetailProfile.tsx @@ -38,7 +38,21 @@ export const DetailProfile = () => { return toast.loading("Loading...") // TODO: change this } - const handleProfileChange = (src: string) => {} + const [profilePict, setProfilePictSrc] = useState(0) + + const handleProfileChange = async (id: number) => { + setProfilePictSrc(id) + + const res = await updateMyPersonalData({ + profilePic: id, + }) + + if (!res.ok) { + return toast.error('Gagal mengganti foto profil') + } + + toast.success('Berhasil mengganti foto profil') + } return (