feat(shangwutong): sync classifications and update conversations
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
/* 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();
|
||||
Reference in New Issue
Block a user