userdetails,resetpass müködöképes lett

This commit is contained in:
2025-10-26 19:46:13 +01:00
parent 18110ba410
commit ab35f73158
7 changed files with 773 additions and 137 deletions
+49
View File
@@ -57,4 +57,53 @@ export const verifyEmail = async (token) => {
}
};
// Get current user profile
export const getUserProfile = async () => {
try {
const response = await apiClient.get("/users/profile");
return response.data;
} catch (error) {
throw error;
}
};
// Update current user profile
export const updateUserProfile = async (data) => {
try {
const response = await apiClient.patch("/users/profile", data);
return response.data;
} catch (error) {
throw error;
}
};
// Delete current user profile
export const deleteUserProfile = async () => {
try {
const response = await apiClient.delete("/users/profile");
return response.data;
} catch (error) {
throw error;
}
};
// Request password reset
export const forgotPassword = async (email) => {
try {
const response = await apiClient.post("/users/forgot-password", { email });
return response.data;
} catch (error) {
throw error;
}
};
// Reset password with token
export const resetPassword = async (token, newPassword) => {
try {
const response = await apiClient.post("/users/reset-password", { token, newPassword });
return response.data;
} catch (error) {
throw error;
}
};