fix: Update article count in portal admin dashboard (#5647)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
@@ -7,14 +7,12 @@ export const actions = {
|
||||
try {
|
||||
commit(types.SET_UI_FLAG, { isFetching: true });
|
||||
const {
|
||||
data: { payload, meta },
|
||||
data: { payload },
|
||||
} = await portalAPIs.get();
|
||||
commit(types.CLEAR_PORTALS);
|
||||
const portalSlugs = payload.map(portal => portal.slug);
|
||||
commit(types.ADD_MANY_PORTALS_ENTRY, payload);
|
||||
commit(types.ADD_MANY_PORTALS_IDS, portalSlugs);
|
||||
|
||||
commit(types.SET_PORTALS_META, meta);
|
||||
} catch (error) {
|
||||
throwErrorMessage(error);
|
||||
} finally {
|
||||
@@ -22,6 +20,21 @@ export const actions = {
|
||||
}
|
||||
},
|
||||
|
||||
show: async ({ commit }, { portalSlug, locale }) => {
|
||||
commit(types.SET_UI_FLAG, { isFetchingItem: true });
|
||||
try {
|
||||
const response = await portalAPIs.getPortal({ portalSlug, locale });
|
||||
const {
|
||||
data: { meta },
|
||||
} = response;
|
||||
commit(types.SET_PORTALS_META, meta);
|
||||
} catch (error) {
|
||||
// Ignore error
|
||||
} finally {
|
||||
commit(types.SET_UI_FLAG, { isFetchingItem: false });
|
||||
}
|
||||
},
|
||||
|
||||
create: async ({ commit }, params) => {
|
||||
commit(types.SET_UI_FLAG, { isCreating: true });
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user