mirror of
https://github.com/TurTaskProject/TurTaskWeb.git
synced 2025-12-20 06:24:07 +01:00
24 lines
561 B
JavaScript
24 lines
561 B
JavaScript
import axios from "axios";
|
|
|
|
const baseURL = import.meta.env.VITE_BASE_URL;
|
|
|
|
const ApiUpdateUserProfile = async (formData) => {
|
|
try {
|
|
const response = await axios.post(`${baseURL}user/update/`, formData, {
|
|
headers: {
|
|
Authorization: "Bearer " + localStorage.getItem("access_token"),
|
|
"Content-Type": "multipart/form-data",
|
|
},
|
|
});
|
|
|
|
console.log(response.data);
|
|
|
|
return response.data;
|
|
} catch (error) {
|
|
console.error("Error updating user profile:", error);
|
|
throw error;
|
|
}
|
|
};
|
|
|
|
export { ApiUpdateUserProfile };
|