You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I work on a React/Typescript app and i'm currently implementing a custom notification interface based on all the hooks available through the package (@novu/notification-center).
I'm facing an error using the following hook : "useUpdateUserGlobalPreferences" and more precisely the "updateUserGlobalPreferences" method available throught this hook
Call the "updateUserGlobalPreferences" method (in the example, with a simple button click)
👍 Expected behavior
It should update user global preferences and return success (or nothing)
👎 Actual Behavior with Screenshots
It actually encounter an error in the "useUpdateUserGlobalPreferences.js" file as mentionned in this error message :
It seems that the function tries to reach a key in the "object" named "old" but this is impossible because of the type of "old" wich seems to be an array :
Novu version
2.0.0-canary.0
npm version
No response
node version
No response
📃 Provide any additional context for the Bug.
The value of "data" object given by the hook "useFetchUserGlobalConfiguration" is the following : [ { "preference": { "enabled": true, "channels": { "email": true, "sms": true, "in_app": true, "chat": true, "push": true } } } ]
👀 Have you spent some time to check if this bug has been raised before?
📜 Description
I work on a React/Typescript app and i'm currently implementing a custom notification interface based on all the hooks available through the package (@novu/notification-center).
I'm facing an error using the following hook : "useUpdateUserGlobalPreferences" and more precisely the "updateUserGlobalPreferences" method available throught this hook
👟 Reproduction steps
Setup a React environment
Install @novu/notification-center package (2.0.0-canary.0)
Create a component using the hook "useUpdateUserGlobalPreferences", for example :
👍 Expected behavior
It should update user global preferences and return success (or nothing)
👎 Actual Behavior with Screenshots
It actually encounter an error in the "useUpdateUserGlobalPreferences.js" file as mentionned in this error message :
It seems that the function tries to reach a key in the "object" named "old" but this is impossible because of the type of "old" wich seems to be an array :
Novu version
2.0.0-canary.0
npm version
No response
node version
No response
📃 Provide any additional context for the Bug.
The value of "data" object given by the hook "useFetchUserGlobalConfiguration" is the following :
[ { "preference": { "enabled": true, "channels": { "email": true, "sms": true, "in_app": true, "chat": true, "push": true } } } ]
👀 Have you spent some time to check if this bug has been raised before?
🏢 Have you read the Contributing Guidelines?
Are you willing to submit PR?
None
The text was updated successfully, but these errors were encountered: