Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SubscriberApi.UpdatePreferences: Broken method #90

Open
Catzilla opened this issue Aug 21, 2024 · 0 comments · May be fixed by #91
Open

SubscriberApi.UpdatePreferences: Broken method #90

Catzilla opened this issue Aug 21, 2024 · 0 comments · May be fixed by #91

Comments

@Catzilla
Copy link

According to API Reference for UpdatePreferences method, channel field should be object, not array

Moreover, this endpoint supports partial update, which means that only enabled or only channel may be set

But if we set only enabled, and set it to false as follow:

opts := &novu.UpdateSubscriberPreferencesOptions{
    Enabled: false,
}

request will fail, because omitempty tag in struct treat false as empty field, and omit it from request

Furthermore, data field in response of this endpoint is a single object, not array, which results in unmarshalling error, making UpdatePreferences method completely useless in current package version

@Catzilla Catzilla linked a pull request Aug 21, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant