profile + update address with location

This commit is contained in:
hamid zarghami
2025-09-17 10:53:52 +03:30
parent 87bc7866fa
commit bc22bbd6d9
8 changed files with 605 additions and 15 deletions
+14
View File
@@ -3,6 +3,8 @@ import { UserMeResponseType } from "@/share/types/SharedTypes";
import {
UpdateProfileRequest,
UpdateProfileResponse,
AddressLocationResponse,
UpdateAddressType,
} from "../types/ProfileTypes";
export const getProfile = async () => {
@@ -17,3 +19,15 @@ export const updateProfile = async (profileData: UpdateProfileRequest) => {
);
return data;
};
export const getAddressByLocation = async (lat: number, lon: number) => {
const { data } = await axios.get<AddressLocationResponse>(
`/address/location/reverse?lat=${lat}&lon=${lon}`
);
return data;
};
export const updateAddress = async (addressData: UpdateAddressType) => {
const { data } = await axios.post("/address/user/save", addressData);
return data;
};