This commit is contained in:
@@ -1,20 +1,12 @@
|
||||
import axios from "@/config/axios";
|
||||
import type {
|
||||
GetRestaurantResponse,
|
||||
UpdateRestaurantType,
|
||||
} from "../types/Types";
|
||||
import type { GetRestaurantResponse, UpdateRestaurantType } from "../types/Types";
|
||||
|
||||
export const getRestaurant = async (): Promise<GetRestaurantResponse> => {
|
||||
const { data } = await axios.get<GetRestaurantResponse>(
|
||||
"/admin/restaurants/my-restaurant"
|
||||
);
|
||||
const { data } = await axios.get<GetRestaurantResponse>("/admin/shops/my-restaurant");
|
||||
return data;
|
||||
};
|
||||
|
||||
export const updateRestaurant = async (params: UpdateRestaurantType) => {
|
||||
const { data } = await axios.patch(
|
||||
"/admin/restaurants/my-restaurant",
|
||||
params
|
||||
);
|
||||
const { data } = await axios.patch("/admin/shops/my-restaurant", params);
|
||||
return data;
|
||||
};
|
||||
|
||||
@@ -1,51 +1,29 @@
|
||||
import axios from "@/config/axios";
|
||||
import type {
|
||||
CreateShipmentMethodType,
|
||||
GetRestaurantShipmentMethodsResponseType,
|
||||
GetRestaurantShipmentMethodResponseType,
|
||||
GetRestaurantShipmentMethodsParams,
|
||||
} from "../types/Types";
|
||||
import type { CreateShipmentMethodType, GetRestaurantShipmentMethodResponseType, GetRestaurantShipmentMethodsParams, GetRestaurantShipmentMethodsResponseType } from "../types/Types";
|
||||
|
||||
export const getRestaurantShipmentMethods = async (
|
||||
params?: GetRestaurantShipmentMethodsParams
|
||||
): Promise<GetRestaurantShipmentMethodsResponseType> => {
|
||||
const { data } = await axios.get("/admin/delivery-methods/restaurant", {
|
||||
export const getRestaurantShipmentMethods = async (params?: GetRestaurantShipmentMethodsParams): Promise<GetRestaurantShipmentMethodsResponseType> => {
|
||||
const { data } = await axios.get("/admin/delivery-methods/shop", {
|
||||
params,
|
||||
});
|
||||
return data;
|
||||
};
|
||||
|
||||
export const createRestaurantShipmentMethod = async (
|
||||
params: CreateShipmentMethodType
|
||||
) => {
|
||||
const { data } = await axios.post(
|
||||
"/admin/delivery-methods/restaurant",
|
||||
params
|
||||
);
|
||||
export const createRestaurantShipmentMethod = async (params: CreateShipmentMethodType) => {
|
||||
const { data } = await axios.post("/admin/delivery-methods/shop", params);
|
||||
return data;
|
||||
};
|
||||
|
||||
export const deleteRestaurantShipmentMethod = async (id: string) => {
|
||||
const { data } = await axios.delete(
|
||||
`/admin/delivery-methods/restaurant/${id}`
|
||||
);
|
||||
const { data } = await axios.delete(`/admin/delivery-methods/shop/${id}`);
|
||||
return data;
|
||||
};
|
||||
|
||||
export const getRestaurantShipmentMethod = async (
|
||||
id: string
|
||||
): Promise<GetRestaurantShipmentMethodResponseType> => {
|
||||
const { data } = await axios.get(`/admin/delivery-methods/restaurant/${id}`);
|
||||
export const getRestaurantShipmentMethod = async (id: string): Promise<GetRestaurantShipmentMethodResponseType> => {
|
||||
const { data } = await axios.get(`/admin/delivery-methods/shop/${id}`);
|
||||
return data;
|
||||
};
|
||||
|
||||
export const updateRestaurantShipmentMethod = async (
|
||||
id: string,
|
||||
params: CreateShipmentMethodType
|
||||
) => {
|
||||
const { data } = await axios.patch(
|
||||
`/admin/delivery-methods/restaurant/${id}`,
|
||||
params
|
||||
);
|
||||
export const updateRestaurantShipmentMethod = async (id: string, params: CreateShipmentMethodType) => {
|
||||
const { data } = await axios.patch(`/admin/delivery-methods/shop/${id}`, params);
|
||||
return data;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user