profile + update address with location
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user