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

x-idempotency-key as optional param #75

Closed
paulMery opened this issue Oct 4, 2022 · 2 comments · Fixed by #76
Closed

x-idempotency-key as optional param #75

paulMery opened this issue Oct 4, 2022 · 2 comments · Fixed by #76
Assignees
Labels
enhancement New feature or request

Comments

@paulMery
Copy link
Contributor

paulMery commented Oct 4, 2022

Could we make this as an optional parameters? Cause we need to set this idempotencyKey on our client side.
Having this key randomly generated when the create function defeat the purpose of having such a key IMO 🤔 .

"x-idempotency-key": randomUUID(),

it would be something like

  async create(transfer, idemPotencyKey = randomUUID()) {
    check(transfer).or(Err.MISSING_TRANSFER);

    const result = await this.moov
      .got({
        url: `transfers`,
        method: "POST",
        headers: {
          "x-idempotency-key": idemPotencyKey,
        },
        json: transfer,
      })
      .json();

    return result;
  }

thanks 🙏

@sethlivingston sethlivingston self-assigned this Oct 4, 2022
@sethlivingston
Copy link
Contributor

We like it. Want to start a PR?

@sethlivingston
Copy link
Contributor

@paulMery this is now available in release v1.1.2. Thanks for your feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants