Skip to content

Commit 7e072ee

Browse files
feat(condo): DOMA-12528 added first arg to NotificationUserSettings query (#7012)
1 parent be4b4b9 commit 7e072ee

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

apps/condo/domains/notification/queries/NotificationUserSetting.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ query getNotificationUserSettings ($userId: ID!, $types: [MessageType!]) {
55
{ user_is_null: true },
66
],
77
messageType_in: $types
8-
}) {
8+
}, first: 100) {
99
id
1010
user { id }
1111
messageType

apps/condo/domains/notification/transports/push.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ const {
1818
PUSH_TRANSPORT_REDSTORE,
1919
TICKET_CREATED_TYPE,
2020
TICKET_COMMENT_CREATED_TYPE,
21+
PASS_TICKET_CREATED_MESSAGE_TYPE,
22+
PASS_TICKET_COMMENT_CREATED_MESSAGE_TYPE,
2123
} = require('@condo/domains/notification/constants/constants')
2224
const { renderTemplate } = require('@condo/domains/notification/templates')
2325
const { RemoteClient } = require('@condo/domains/notification/utils/serverSchema')
@@ -28,6 +30,8 @@ const logger = getLogger()
2830
const TEMPORARY_DISABLED_TYPES_FOR_PUSH_NOTIFICATIONS = [
2931
TICKET_CREATED_TYPE,
3032
TICKET_COMMENT_CREATED_TYPE,
33+
PASS_TICKET_CREATED_MESSAGE_TYPE,
34+
PASS_TICKET_COMMENT_CREATED_MESSAGE_TYPE,
3135
]
3236

3337
const ADAPTERS = {
@@ -164,7 +168,7 @@ async function send ({ notification, data, user, remoteClient } = {}, isVoIP = f
164168
let _isOk = false
165169

166170
if (TEMPORARY_DISABLED_TYPES_FOR_PUSH_NOTIFICATIONS.includes(get(data, 'type'))) {
167-
return [false, { error: 'Temporrary disabled types for push notifications' }]
171+
return [false, { error: 'Disabled type for push transport' }]
168172
}
169173
if (!count) return [false, { error: 'No pushTokens available.' }]
170174

apps/condo/gql/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2696,6 +2696,7 @@ export const GetNotificationUserSettingsDocument = gql`
26962696
query getNotificationUserSettings($userId: ID!, $types: [MessageType!]) {
26972697
allNotificationUserSettings(
26982698
where: {OR: [{user: {id: $userId}}, {user_is_null: true}], messageType_in: $types}
2699+
first: 100
26992700
) {
27002701
id
27012702
user {

0 commit comments

Comments
 (0)