| import api from './axiosInstance.api'; | |
| interface LocationUpdatePayload { | |
| longitude: number; | |
| latitude: number; | |
| } | |
| interface LocationUpdateResponse { | |
| message: string; | |
| } | |
| const locationHistoryApi = { | |
| /** | |
| * Update user's current location | |
| * @param longitude - Longitude coordinate | |
| * @param latitude - Latitude coordinate | |
| */ | |
| updateLocation: async (longitude: number, latitude: number): Promise<LocationUpdateResponse> => { | |
| const payload: LocationUpdatePayload = { longitude, latitude }; | |
| const response = await api.post<LocationUpdateResponse>('/location/update', payload); | |
| return response.data; | |
| }, | |
| }; | |
| export default locationHistoryApi; | |