restuarants to shop
deploy to danak / build_and_deploy (push) Has been cancelled

This commit is contained in:
hamid zarghami
2026-06-16 14:26:04 +03:30
parent 592ee87087
commit da74ef6cd6
2 changed files with 13 additions and 43 deletions
+3 -11
View File
@@ -1,20 +1,12 @@
import axios from "@/config/axios"; import axios from "@/config/axios";
import type { import type { GetRestaurantResponse, UpdateRestaurantType } from "../types/Types";
GetRestaurantResponse,
UpdateRestaurantType,
} from "../types/Types";
export const getRestaurant = async (): Promise<GetRestaurantResponse> => { export const getRestaurant = async (): Promise<GetRestaurantResponse> => {
const { data } = await axios.get<GetRestaurantResponse>( const { data } = await axios.get<GetRestaurantResponse>("/admin/shops/my-restaurant");
"/admin/restaurants/my-restaurant"
);
return data; return data;
}; };
export const updateRestaurant = async (params: UpdateRestaurantType) => { export const updateRestaurant = async (params: UpdateRestaurantType) => {
const { data } = await axios.patch( const { data } = await axios.patch("/admin/shops/my-restaurant", params);
"/admin/restaurants/my-restaurant",
params
);
return data; return data;
}; };
@@ -1,51 +1,29 @@
import axios from "@/config/axios"; import axios from "@/config/axios";
import type { import type { CreateShipmentMethodType, GetRestaurantShipmentMethodResponseType, GetRestaurantShipmentMethodsParams, GetRestaurantShipmentMethodsResponseType } from "../types/Types";
CreateShipmentMethodType,
GetRestaurantShipmentMethodsResponseType,
GetRestaurantShipmentMethodResponseType,
GetRestaurantShipmentMethodsParams,
} from "../types/Types";
export const getRestaurantShipmentMethods = async ( export const getRestaurantShipmentMethods = async (params?: GetRestaurantShipmentMethodsParams): Promise<GetRestaurantShipmentMethodsResponseType> => {
params?: GetRestaurantShipmentMethodsParams const { data } = await axios.get("/admin/delivery-methods/shop", {
): Promise<GetRestaurantShipmentMethodsResponseType> => {
const { data } = await axios.get("/admin/delivery-methods/restaurant", {
params, params,
}); });
return data; return data;
}; };
export const createRestaurantShipmentMethod = async ( export const createRestaurantShipmentMethod = async (params: CreateShipmentMethodType) => {
params: CreateShipmentMethodType const { data } = await axios.post("/admin/delivery-methods/shop", params);
) => {
const { data } = await axios.post(
"/admin/delivery-methods/restaurant",
params
);
return data; return data;
}; };
export const deleteRestaurantShipmentMethod = async (id: string) => { export const deleteRestaurantShipmentMethod = async (id: string) => {
const { data } = await axios.delete( const { data } = await axios.delete(`/admin/delivery-methods/shop/${id}`);
`/admin/delivery-methods/restaurant/${id}`
);
return data; return data;
}; };
export const getRestaurantShipmentMethod = async ( export const getRestaurantShipmentMethod = async (id: string): Promise<GetRestaurantShipmentMethodResponseType> => {
id: string const { data } = await axios.get(`/admin/delivery-methods/shop/${id}`);
): Promise<GetRestaurantShipmentMethodResponseType> => {
const { data } = await axios.get(`/admin/delivery-methods/restaurant/${id}`);
return data; return data;
}; };
export const updateRestaurantShipmentMethod = async ( export const updateRestaurantShipmentMethod = async (id: string, params: CreateShipmentMethodType) => {
id: string, const { data } = await axios.patch(`/admin/delivery-methods/shop/${id}`, params);
params: CreateShipmentMethodType
) => {
const { data } = await axios.patch(
`/admin/delivery-methods/restaurant/${id}`,
params
);
return data; return data;
}; };