diff --git a/packages/restapi/src/lib/channels/signature.helpers.ts b/packages/restapi/src/lib/channels/signature.helpers.ts index c67e456e4..fadb4e480 100644 --- a/packages/restapi/src/lib/channels/signature.helpers.ts +++ b/packages/restapi/src/lib/channels/signature.helpers.ts @@ -30,7 +30,7 @@ export const getSubscriptionMessageV2 = ( channel: string, userAddress: string, action: channelActionType, - userSetting?: string + userSetting?: string | null ) => { const actionTypeKey = action === 'Unsubscribe' ? 'unsubscriber' : 'subscriber'; diff --git a/packages/restapi/src/lib/channels/subscribeV2.ts b/packages/restapi/src/lib/channels/subscribeV2.ts index 05052ba45..ed4b4d857 100644 --- a/packages/restapi/src/lib/channels/subscribeV2.ts +++ b/packages/restapi/src/lib/channels/subscribeV2.ts @@ -17,7 +17,7 @@ export type SubscribeOptionsV2Type = { signer: SignerType; channelAddress: string; userAddress: string; - settings?: string; + settings?: string | null; verifyingContractAddress?: string; env?: ENV; onSuccess?: () => void; diff --git a/packages/restapi/src/lib/pushNotification/pushNotificationBase.ts b/packages/restapi/src/lib/pushNotification/pushNotificationBase.ts index b18ab6bdb..37d6b138c 100644 --- a/packages/restapi/src/lib/pushNotification/pushNotificationBase.ts +++ b/packages/restapi/src/lib/pushNotification/pushNotificationBase.ts @@ -701,6 +701,9 @@ export class PushNotificationBaseClass { } protected getMinimalUserSetting(setting: UserSetting[]) { + if(!setting){ + return null; + } let userSetting = ''; let numberOfSettings = 0; for (let i = 0; i < setting.length; i++) { diff --git a/packages/restapi/tests/lib/pushNotification/base.test.ts b/packages/restapi/tests/lib/pushNotification/onchain.test.ts similarity index 100% rename from packages/restapi/tests/lib/pushNotification/base.test.ts rename to packages/restapi/tests/lib/pushNotification/onchain.test.ts