35 lines
834 B
JavaScript
35 lines
834 B
JavaScript
/* global axios */
|
|
import ApiClient from './ApiClient';
|
|
|
|
class ShangwutongClassificationsAPI extends ApiClient {
|
|
constructor() {
|
|
super('inboxes', { accountScoped: true });
|
|
this.conversations = new ApiClient('conversations', {
|
|
accountScoped: true,
|
|
});
|
|
}
|
|
|
|
get(inboxId) {
|
|
return axios.get(`${this.url}/${inboxId}/shangwutong/classifications`);
|
|
}
|
|
|
|
sync(inboxId) {
|
|
return axios.post(
|
|
`${this.url}/${inboxId}/shangwutong/classifications/sync`
|
|
);
|
|
}
|
|
|
|
updateConversation(conversationId, payload) {
|
|
return axios.patch(
|
|
`${this.conversations.url}/${conversationId}/shangwutong-classifications`,
|
|
payload
|
|
);
|
|
}
|
|
|
|
getConversation(conversationId) {
|
|
return axios.get(`${this.conversations.url}/${conversationId}`);
|
|
}
|
|
}
|
|
|
|
export default new ShangwutongClassificationsAPI();
|