create attribute
This commit is contained in:
@@ -5,7 +5,11 @@ import {
|
||||
useQueryClient,
|
||||
} from "@tanstack/react-query";
|
||||
import * as api from "../service/ProductService";
|
||||
import type { CreateCategoryType, CreateProductType } from "../types/Types";
|
||||
import type {
|
||||
CreateAttributeType,
|
||||
CreateCategoryType,
|
||||
CreateProductType,
|
||||
} from "../types/Types";
|
||||
|
||||
export const useGetCategory = () => {
|
||||
return useQuery({
|
||||
@@ -86,3 +90,10 @@ export const useDeleteProduct = () => {
|
||||
mutationFn: (id: number) => api.deleteProduct(id),
|
||||
});
|
||||
};
|
||||
|
||||
export const useCreateAttribute = () => {
|
||||
return useMutation({
|
||||
mutationFn: ({ id, params }: { id: number; params: CreateAttributeType }) =>
|
||||
api.createAttribute(id, params),
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user