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

[BUG] Terminal settings types: null should be allowed as value for various fields #1351

Open
naseemkullah opened this issue May 3, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@naseemkullah
Copy link

*for settings at any level that can inherit from a level above

Describe the bug
The only way to clear a terminal-level terminal setting via API so that it inherits from the store-level setting is to provide null as a value.

This is my current workaround, and it works fine, but would be great to fixup the types to allow null where it can be passed to clear a setting at a terminal-level, making it inherit the store-level setting.

    // the use of `as unknown as undefined` is a workaround for a type issue in Adyen's SDK
    // `null` does in fact clear the value at the Terminal level, to then inherit the value
    // from the Store level, however the typings do not allow for `null` to be passed
    {
      gratuities: null as unknown as undefined,
      hardware: {
        restartHour: null as unknown as undefined,
        resetTotalsHour: null as unknown as undefined,
      },
      localization: null as unknown as undefined,
      nexo: null as unknown as undefined,
      payAtTable: null as unknown as undefined,
      receiptOptions: null as unknown as undefined,
      receiptPrinting: null as unknown as undefined,
      standalone: null as unknown as undefined,
    }
@naseemkullah naseemkullah added the bug Something isn't working label May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant