SudoSOS Back-end API / service/user-notification-preference-service / UserNotificationPreferenceService
Class: UserNotificationPreferenceService ​
Extends ​
Constructors ​
Constructor ​
new UserNotificationPreferenceService(manager?): UserNotificationPreferenceService;Parameters ​
| Parameter | Type |
|---|---|
manager? | EntityManager |
Returns ​
UserNotificationPreferenceService
Inherited from ​
Properties ​
| Property | Modifier | Type | Inherited from |
|---|---|---|---|
manager | protected | EntityManager | WithManager.manager |
Methods ​
createUserNotificationPreference() ​
createUserNotificationPreference(requestParams): Promise<UserNotificationPreference>;Creates an UserNotificationPreference from an UserNotificationPreferenceRequest
Parameters ​
| Parameter | Type | Description |
|---|---|---|
requestParams | UserNotificationPreferenceRequestParams | - |
Returns ​
Promise<UserNotificationPreference>
getPaginatedUserNotificationPreference() ​
getPaginatedUserNotificationPreference(params?, pagination?): Promise<PaginatedUserNotificationPreferenceResponse>;Returns all UserNotificationPreferences based on given params
Parameters ​
| Parameter | Type | Description |
|---|---|---|
params | UserNotificationPreferenceFilterParams | - |
pagination | PaginationParameters | The pagination to apply |
Returns ​
Promise<PaginatedUserNotificationPreferenceResponse>
getUserNotificationPreferences() ​
getUserNotificationPreferences(params?): Promise<UserNotificationPreference[]>;Returns UserNotificationPreferences based on the given filter params
Parameters ​
| Parameter | Type | Description |
|---|---|---|
params | UserNotificationPreferenceFilterParams | - |
Returns ​
Promise<UserNotificationPreference[]>
syncAllUserNotificationPreferences() ​
syncAllUserNotificationPreferences(): Promise<void>;Sync all users with all types of notification and channels
Returns ​
Promise<void>
updateUserNotificationPreference() ​
updateUserNotificationPreference(update): Promise<UserNotificationPreference>;Updates the UserNotificationPreference
It is only possible to change the enabled boolean in the database.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
update | UserNotificationPreferenceUpdateParams | - |
Returns ​
Promise<UserNotificationPreference>
asResponse() ​
static asResponse(userNotificationPreference): BaseUserNotificationPreferenceResponse;Parses an UserNotificationPreference Object to a BaseUserNotificationPreferenceResponse
Parameters ​
| Parameter | Type | Description |
|---|---|---|
userNotificationPreference | UserNotificationPreference | The UserNotificationPreference to parse |
Returns ​
BaseUserNotificationPreferenceResponse
getOptions() ​
static getOptions(params): FindManyOptions<UserNotificationPreference>;Parameters ​
| Parameter | Type |
|---|---|
params | UserNotificationPreferenceFilterParams |
Returns ​
FindManyOptions<UserNotificationPreference>
toArrayResponse() ​
static toArrayResponse(userNotificationPreferences): BaseUserNotificationPreferenceResponse[];Parameters ​
| Parameter | Type |
|---|---|
userNotificationPreferences | UserNotificationPreference[] |