update a resutarant

This commit is contained in:
hamid zarghami
2026-01-06 09:10:51 +03:30
parent 9af21acb90
commit 37717d5f05
8 changed files with 262 additions and 3 deletions
+21
View File
@@ -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,
});
};