mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 03:57:52 +00:00
feat: notification center (#1612)
Co-authored-by: Pranav <pranav@chatwoot.com>
This commit is contained in:
33
app/javascript/dashboard/api/notifications.js
Normal file
33
app/javascript/dashboard/api/notifications.js
Normal file
@@ -0,0 +1,33 @@
|
||||
/* global axios */
|
||||
import ApiClient from './ApiClient';
|
||||
|
||||
class NotificationsAPI extends ApiClient {
|
||||
constructor() {
|
||||
super('notifications', { accountScoped: true });
|
||||
}
|
||||
|
||||
get(page) {
|
||||
return axios.get(`${this.url}?page=${page}`);
|
||||
}
|
||||
|
||||
getNotifications(contactId) {
|
||||
return axios.get(`${this.url}/${contactId}/notifications`);
|
||||
}
|
||||
|
||||
getUnreadCount() {
|
||||
return axios.get(`${this.url}/unread_count`);
|
||||
}
|
||||
|
||||
read(primaryActorType, primaryActorId) {
|
||||
return axios.post(`${this.url}/read_all`, {
|
||||
primary_actor_type: primaryActorType,
|
||||
primary_actor_id: primaryActorId,
|
||||
});
|
||||
}
|
||||
|
||||
readAll() {
|
||||
return axios.post(`${this.url}/read_all`);
|
||||
}
|
||||
}
|
||||
|
||||
export default new NotificationsAPI();
|
||||
Reference in New Issue
Block a user