feat: Articles store integration (#5133)

This commit is contained in:
Muhsin Keloth
2022-08-02 17:14:10 +05:30
committed by GitHub
parent 82207c0d3e
commit 5735a8e377
22 changed files with 272 additions and 82 deletions

View File

@@ -1,16 +1,14 @@
export const getters = {
uiFlagsIn: state => helpCenterId => {
uiFlags: state => helpCenterId => {
const uiFlags = state.articles.uiFlags.byId[helpCenterId];
if (uiFlags) return uiFlags;
return { isFetching: false, isUpdating: false, isDeleting: false };
},
isFetchingHelpCenterArticles: state => state.uiFlags.isFetching,
isFetching: state => state.uiFlags.isFetching,
articleById: (...getterArguments) => articleId => {
const [state] = getterArguments;
const article = state.articles.byId[articleId];
if (!article) return undefined;
return article;
},
allArticles: (...getterArguments) => {
@@ -20,4 +18,7 @@ export const getters = {
});
return articles;
},
getMeta: state => {
return state.meta;
},
};