Fixes: None; Extra: 1) Create Pinia stores for app, user, category, and company management; 2) Add utility functions for error handling and category slug lookups; 3) Include German locale file and robots.txt for improved SEO and accessibility; 4) Add SVG assets and improve general folder structure for better maintainability.
17 lines
460 B
TypeScript
17 lines
460 B
TypeScript
import type {ICategory} from "~/types";
|
|
|
|
export const useCategoryStore = defineStore('category', () => {
|
|
const categories = ref<{ node: ICategory; }[] | []>([])
|
|
const setCategories = (payload: { node: ICategory; }[]) => {
|
|
categories.value = payload
|
|
};
|
|
const addCategories = (payload: { node: ICategory; }[]) => {
|
|
categories.value = [...categories.value, ...payload];
|
|
};
|
|
|
|
return {
|
|
categories,
|
|
setCategories,
|
|
addCategories
|
|
}
|
|
})
|