import services from '../services' ; import { Article } from '../types/article.interface' ; import { NumberString } from '../types/NumberString.interface' ; import { ListResponse } from '../types/response/list.response' ; export type ArticleList = ListResponse < Article > & { page : NumberString ; } ; export const articleList = { state : { count : 0 , list : [ ] , page : 0 } as ArticleList , reducers : { reset ( state ) { return { count : 0 , list : [ ] , page : 0 } as ArticleList ; } , } , effects : { async getList ( state , payload ) { const data = await services . article . visitor . getList ( payload ) ; return { ... data , page : payload . page , } ; } , async getAdminList ( state , payload ) { const data = await services . article . user . getList ( payload ) ; return { ... data , page : payload . page , } ; } , } , } ;