update a resutarant
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
ReportsResponse,
|
||||
SystemRolesResponse,
|
||||
RestaurantAdminsResponse,
|
||||
UpdateRestaurantType,
|
||||
} from "../types/Types";
|
||||
|
||||
export const useGetIcons = () => {
|
||||
@@ -98,3 +99,23 @@ export const useGetSystemRoles = () => {
|
||||
queryFn: api.getSystemRoles,
|
||||
});
|
||||
};
|
||||
|
||||
export const useUpdateRestaurant = () => {
|
||||
return useMutation({
|
||||
mutationFn: ({
|
||||
id,
|
||||
params,
|
||||
}: {
|
||||
id: string;
|
||||
params: UpdateRestaurantType;
|
||||
}) => api.updateRestaurant(id, params),
|
||||
});
|
||||
};
|
||||
|
||||
export const useGetRestaurant = (id: string) => {
|
||||
return useQuery({
|
||||
queryKey: ["restaurant", id],
|
||||
queryFn: () => api.getRestaurant(id),
|
||||
enabled: !!id,
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user