feat: Add store to manage categories (#5127)

This commit is contained in:
Fayaz Ahmed
2022-08-04 15:11:29 +05:30
committed by GitHub
parent d55a8f7987
commit 7c5ee55d3e
14 changed files with 613 additions and 10 deletions

View File

@@ -1,6 +1,7 @@
import portalAPI from 'dashboard/api/helpCenter/portals';
import PortalAPI from 'dashboard/api/helpCenter/portals';
import articlesAPI from 'dashboard/api/helpCenter/articles';
import { throwErrorMessage } from 'dashboard/store/utils/api';
const portalAPIs = new PortalAPI();
import types from '../../mutation-types';
export const actions = {
index: async ({ commit }, { pageNumber, portalSlug, locale }) => {
@@ -8,7 +9,7 @@ export const actions = {
commit(types.SET_UI_FLAG, { isFetching: true });
const {
data: { payload, meta },
} = await portalAPI.getArticles({
} = await portalAPIs.getArticles({
pageNumber,
portalSlug,
locale,
@@ -44,7 +45,7 @@ export const actions = {
show: async ({ commit }, { id, portalSlug }) => {
commit(types.SET_UI_FLAG, { isFetching: true });
try {
const response = await portalAPI.getArticle({ id, portalSlug });
const response = await articlesAPI.getArticle({ id, portalSlug });
const {
data: { payload },
} = response;