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

Add $count option to get api keys methods #1293

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JSReds
Copy link
Contributor

@JSReds JSReds commented Jan 24, 2023

Change-type: minor
Signed-off-by: Andrea Rosci andrear@balena.io


Contributor checklist
  • Includes tests
  • Includes typings
  • Includes updated documentation
  • Includes updated build output

Change-type: minor
Signed-off-by: Andrea Rosci <andrear@balena.io>
@JSReds JSReds self-assigned this Jan 24, 2023
@JSReds JSReds requested a review from thgreasi January 24, 2023 14:42
name: {
$ne: null,
},
): Promise<BalenaSdk.ApiKey[] | number> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to keep this in the UI atm, otherwise in order to get it in the SDK we need to define overloads for the methods, so that when TS sees that $count is defined it then uses the overload that returns a number.
You can check the .get() pinejs-client typings in the SDK to check how we defined the overloads for when ParamsObjWithCount is provided.

Comment on lines +286 to 289
$count: {
...internalOptions,
...options.$count,
},
Copy link
Member

@thgreasi thgreasi Jan 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be v ?

Suggested change
$count: {
...internalOptions,
...options.$count,
},
$count: mergePineOptions(internalOptions, options.$count),

Applies in all methods

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 this pull request may close these issues.

2 participants