import services from '../services' ; import { Article } from '../types/article.interface' ; import { Category } from '../types/category.interface' ; export type CategoryState = Category | null ; export const category = { state : null as CategoryState , reducers : { } , effects : { async addCategory ( state , payload ) { return services . category . user . createCategory ( payload ) ; } , async updateCategory ( state , payload ) { return services . category . user . updateCategory ( payload ) ; } , async updateArticle ( state , payload ) { return services . article . user . updateArticle ( payload ) ; } , async deleteArticle ( state , payload ) { return services . article . user . deleteArticle ( payload ) ; } } , } ;