mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 12:08:01 +00:00
feat: Add store to manage categories (#5127)
This commit is contained in:
27
app/javascript/dashboard/api/helpCenter/categories.js
Normal file
27
app/javascript/dashboard/api/helpCenter/categories.js
Normal file
@@ -0,0 +1,27 @@
|
||||
/* 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();
|
||||
Reference in New Issue
Block a user