bug fix
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import type {
|
||||
AllAmenitiesData,
|
||||
CreateTourRes,
|
||||
DetailAmenitiesData,
|
||||
GetAllTours,
|
||||
GetDetailTours,
|
||||
GetHotelRes,
|
||||
@@ -19,6 +21,7 @@ import type {
|
||||
} from "@/pages/tours/lib/type";
|
||||
import httpClient from "@/shared/config/api/httpClient";
|
||||
import {
|
||||
AMENITIES,
|
||||
GET_TICKET,
|
||||
HOTEL,
|
||||
HOTEL_BADGE,
|
||||
@@ -444,13 +447,71 @@ const hotelFeatureTypeDelete = async ({ id }: { id: number }) => {
|
||||
return response;
|
||||
};
|
||||
|
||||
//Amenities
|
||||
|
||||
const getAllAmenities = async ({
|
||||
page,
|
||||
page_size,
|
||||
}: {
|
||||
page_size: number;
|
||||
page: number;
|
||||
}): Promise<AxiosResponse<AllAmenitiesData>> => {
|
||||
const response = await httpClient.get(AMENITIES, {
|
||||
params: { page, page_size },
|
||||
});
|
||||
return response;
|
||||
};
|
||||
|
||||
const amenitiesCreate = async ({
|
||||
body,
|
||||
}: {
|
||||
body: {
|
||||
name: string;
|
||||
name_ru: string;
|
||||
icon_name: string;
|
||||
};
|
||||
}) => {
|
||||
const response = await httpClient.post(AMENITIES, body);
|
||||
return response;
|
||||
};
|
||||
|
||||
const deleteAmenities = async ({ id }: { id: number }) => {
|
||||
const response = await httpClient.delete(`${AMENITIES}${id}/`);
|
||||
return response;
|
||||
};
|
||||
|
||||
const getDetailAmenities = async ({
|
||||
id,
|
||||
}: {
|
||||
id: number;
|
||||
}): Promise<AxiosResponse<DetailAmenitiesData>> => {
|
||||
const response = await httpClient.get(`${AMENITIES}${id}/`);
|
||||
return response;
|
||||
};
|
||||
|
||||
const amenitiesUpdate = async ({
|
||||
id,
|
||||
body,
|
||||
}: {
|
||||
id: number;
|
||||
body: { name: string; name_ru: string; icon_name: string };
|
||||
}) => {
|
||||
const response = await httpClient.patch(`${AMENITIES}${id}/`, body);
|
||||
return response;
|
||||
};
|
||||
|
||||
export {
|
||||
addedPopularTours,
|
||||
amenitiesCreate,
|
||||
amenitiesUpdate,
|
||||
createHotel,
|
||||
createTours,
|
||||
deleteAmenities,
|
||||
deleteTours,
|
||||
editHotel,
|
||||
getAllAmenities,
|
||||
getAllTours,
|
||||
getDetailAmenities,
|
||||
getDetailToursId,
|
||||
getHotel,
|
||||
getOneTours,
|
||||
|
||||
Reference in New Issue
Block a user