Feat: Assign conversations to teams. (#1849)

This commit is contained in:
Nithin David Thomas 2021-03-15 18:37:03 +05:30 committed by GitHub
parent 941d4219f0
commit c99c63cd79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 231 additions and 12 deletions

View file

@ -33,12 +33,17 @@ class ConversationApi extends ApiClient {
}
assignAgent({ conversationId, agentId }) {
axios.post(
return axios.post(
`${this.url}/${conversationId}/assignments?assignee_id=${agentId}`,
{}
);
}
assignTeam({ conversationId, teamId }) {
const params = { team_id: teamId };
return axios.post(`${this.url}/${conversationId}/assignments`, params);
}
markMessageRead({ id }) {
return axios.post(`${this.url}/${id}/update_last_seen`);
}

View file

@ -11,6 +11,7 @@ describe('#ConversationAPI', () => {
expect(conversationAPI).toHaveProperty('delete');
expect(conversationAPI).toHaveProperty('toggleStatus');
expect(conversationAPI).toHaveProperty('assignAgent');
expect(conversationAPI).toHaveProperty('assignTeam');
expect(conversationAPI).toHaveProperty('markMessageRead');
expect(conversationAPI).toHaveProperty('toggleTyping');
expect(conversationAPI).toHaveProperty('mute');