catalog connected to backend
This commit is contained in:
@@ -4,6 +4,7 @@ import { create } from "zustand";
|
||||
interface CategoryZustandType {
|
||||
category: CategoryType;
|
||||
setCategory: (category: CategoryType) => void;
|
||||
clearCatalog: () => void;
|
||||
}
|
||||
|
||||
const demoCategory: CategoryType = {
|
||||
@@ -11,9 +12,11 @@ const demoCategory: CategoryType = {
|
||||
name: "",
|
||||
description: "",
|
||||
image: "",
|
||||
have_sub_category: false,
|
||||
};
|
||||
|
||||
export const useCategory = create<CategoryZustandType>((set) => ({
|
||||
category: demoCategory,
|
||||
setCategory: (data) => set({ category: data }),
|
||||
clearCatalog: () => set({ category: demoCategory }),
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user