这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

SubscriberApi.UpdatePreferences: Broken method #90

@Catzilla

Description

@Catzilla

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions