Feature: Improve label experience (#975)
Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
@@ -6,13 +6,14 @@ class ConversationApi extends ApiClient {
|
||||
super('conversations', { accountScoped: true });
|
||||
}
|
||||
|
||||
get({ inboxId, status, assigneeType, page }) {
|
||||
get({ inboxId, status, assigneeType, page, labels }) {
|
||||
return axios.get(this.url, {
|
||||
params: {
|
||||
inbox_id: inboxId,
|
||||
status,
|
||||
assignee_type: assigneeType,
|
||||
page,
|
||||
labels,
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -44,12 +45,13 @@ class ConversationApi extends ApiClient {
|
||||
return axios.post(`${this.url}/${conversationId}/mute`);
|
||||
}
|
||||
|
||||
meta({ inboxId, status, assigneeType }) {
|
||||
meta({ inboxId, status, assigneeType, labels }) {
|
||||
return axios.get(`${this.url}/meta`, {
|
||||
params: {
|
||||
inbox_id: inboxId,
|
||||
status,
|
||||
assignee_type: assigneeType,
|
||||
labels,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
9
app/javascript/dashboard/api/labels.js
Normal file
9
app/javascript/dashboard/api/labels.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import ApiClient from './ApiClient';
|
||||
|
||||
class LabelsAPI extends ApiClient {
|
||||
constructor() {
|
||||
super('labels', { accountScoped: true });
|
||||
}
|
||||
}
|
||||
|
||||
export default new LabelsAPI();
|
||||
14
app/javascript/dashboard/api/specs/labels.spec.js
Normal file
14
app/javascript/dashboard/api/specs/labels.spec.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import labels from '../labels';
|
||||
import ApiClient from '../ApiClient';
|
||||
|
||||
describe('#LabelsAPI', () => {
|
||||
it('creates correct instance', () => {
|
||||
expect(labels).toBeInstanceOf(ApiClient);
|
||||
expect(labels).toHaveProperty('get');
|
||||
expect(labels).toHaveProperty('show');
|
||||
expect(labels).toHaveProperty('create');
|
||||
expect(labels).toHaveProperty('update');
|
||||
expect(labels).toHaveProperty('delete');
|
||||
expect(labels.url).toBe('/api/v1/labels');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user