NotificationService
1. Import the service from our library:
import {NotificationService} from "@selfcommunity/api-services";
2. Create a function and put the service inside it!
The async function `listUserNotification` will return the paginated list of notifications.
async listUserNotification() {
return await NotificationService.listUserNotification();
}
In case of required `params`, just add them inside the brackets.
async disposeBroadcastMessages(banner_ids) {
return await NotificationService.disposeBroadcastMessages(banner_ids);
}
If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).
1. Declare it(or declare them, it is possible to add multiple params)
const headers = headers: {Authorization: `Bearer ${yourToken}`}
2. Add it inside the brackets and pass it to the function, as shown in the previous example!
Constructors
new NotificationService()
new NotificationService():
NotificationService
Returns
Methods
createCustomNotification()
static
createCustomNotification(data
,config
?):Promise
<any
>
Parameters
Parameter | Type |
---|---|
data | CustomNotificationParams |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
services/notification/index.ts:164
disposeBroadcastMessages()
static
disposeBroadcastMessages(banner_ids
,config
?):Promise
<any
>
Parameters
Parameter | Type |
---|---|
banner_ids | number [] |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
services/notification/index.ts:176
getUnseenNotification()
static
getUnseenNotification(config
?):Promise
<SCNotificationUnseenCountType
>
Parameters
Parameter | Type |
---|---|
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCNotificationUnseenCountType
>
Source
services/notification/index.ts:161
listBroadcastMessages()
static
listBroadcastMessages(config
?):Promise
<SCPaginatedResponse
<SCBroadcastMessageType
>>
Parameters
Parameter | Type |
---|---|
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCBroadcastMessageType
>>
Source
services/notification/index.ts:167
listBroadcastMessagesUndisposedCount()
static
listBroadcastMessagesUndisposedCount(config
?):Promise
<SCNotificationUnseenCountType
>
Parameters
Parameter | Type |
---|---|
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCNotificationUnseenCountType
>
Source
services/notification/index.ts:173
listBroadcastMessagesUnseenCount()
static
listBroadcastMessagesUnseenCount(config
?):Promise
<SCNotificationUnseenCountType
>
Parameters
Parameter | Type |
---|---|
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCNotificationUnseenCountType
>
Source
services/notification/index.ts:170
listUserNotification()
static
listUserNotification(config
?):Promise
<SCPaginatedResponse
<SCNotificationAggregatedType
>>
Parameters
Parameter | Type |
---|---|
config ? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCNotificationAggregatedType
>>
Source
services/notification/index.ts:155
markReadBroadcastMessages()
static
markReadBroadcastMessages(banner_ids
,config
?):Promise
<any
>
Parameters
Parameter | Type |
---|---|
banner_ids | number [] |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Source
services/notification/index.ts:179
markReadNotification()
static
markReadNotification(sids
,config
?):Promise
<any
>
Parameters
Parameter | Type |
---|---|
sids | string [] |
config ? | AxiosRequestConfig <any > |
Returns
Promise
<any
>