26 lines
656 B
TypeScript
26 lines
656 B
TypeScript
import type { TourItem } from "@/features/tour-plan/lib/types";
|
|
import httpClient from "@/shared/config/api/httpClient";
|
|
import { TOUR_PLAN } from "@/shared/config/api/URLs";
|
|
import type { AxiosResponse } from "axios";
|
|
|
|
export const tour_plan_api = {
|
|
async list(): Promise<AxiosResponse<TourItem>> {
|
|
const res = await httpClient.get(`${TOUR_PLAN}list/`);
|
|
return res;
|
|
},
|
|
|
|
async send_location({
|
|
id,
|
|
body,
|
|
}: {
|
|
body: {
|
|
longitude: number;
|
|
latitude: number;
|
|
};
|
|
id: number;
|
|
}): Promise<AxiosResponse<TourItem>> {
|
|
const res = await httpClient.patch(`${TOUR_PLAN}${id}/update/`, body);
|
|
return res;
|
|
},
|
|
};
|