Feature: Add UI to update email notification preferences (#579)
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import userNotificationSettings from '../userNotificationSettings';
|
||||
import ApiClient from '../ApiClient';
|
||||
|
||||
describe('#AgentAPI', () => {
|
||||
it('creates correct instance', () => {
|
||||
expect(userNotificationSettings).toBeInstanceOf(ApiClient);
|
||||
expect(userNotificationSettings).toHaveProperty('get');
|
||||
expect(userNotificationSettings).toHaveProperty('show');
|
||||
expect(userNotificationSettings).toHaveProperty('create');
|
||||
expect(userNotificationSettings).toHaveProperty('update');
|
||||
expect(userNotificationSettings).toHaveProperty('delete');
|
||||
});
|
||||
});
|
||||
14
app/javascript/dashboard/api/userNotificationSettings.js
Normal file
14
app/javascript/dashboard/api/userNotificationSettings.js
Normal file
@@ -0,0 +1,14 @@
|
||||
/* global axios */
|
||||
import ApiClient from './ApiClient';
|
||||
|
||||
class UserNotificationSettings extends ApiClient {
|
||||
constructor() {
|
||||
super('user/notification_settings');
|
||||
}
|
||||
|
||||
update(params) {
|
||||
return axios.patch(`${this.url}`, params);
|
||||
}
|
||||
}
|
||||
|
||||
export default new UserNotificationSettings();
|
||||
Reference in New Issue
Block a user