Chatwoot/app/javascript/dashboard/api/helpCenter/categories.js
2022-08-04 15:11:29 +05:30

27 lines
666 B
JavaScript

/* global axios */
import PortalsAPI from './portals';
class CategoriesAPI extends PortalsAPI {
constructor() {
super('categories', { accountScoped: true });
}
get({ portalSlug }) {
return axios.get(`${this.url}/${portalSlug}/categories`);
}
create({ portalSlug, categoryObj }) {
return axios.post(`${this.url}/${portalSlug}/categories`, categoryObj);
}
update({ portalSlug, categoryObj }) {
return axios.patch(`${this.url}/${portalSlug}/categories`, categoryObj);
}
delete({ portalSlug, categoryId }) {
return axios.delete(`${this.url}/${portalSlug}/categories/${categoryId}`);
}
}
export default new CategoriesAPI();