-
Notifications
You must be signed in to change notification settings - Fork 1
fix(chart.getPanels): make the query params optional #477
fix(chart.getPanels): make the query params optional #477
Conversation
When the array is empty, the SDK strips the query param from the query, so the schema doesn't type check
@@ -22,10 +22,10 @@ type Panel = { | |||
}; | |||
|
|||
type Request = { | |||
body: Record<KindsResources, Array<{ | |||
body: Partial<Record<KindsResources, Array<{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this is what we want; how can the api update panels if the contents of the request body is optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here it will update nothing, I think
@@ -13,7 +13,7 @@ const kindsResources = ['pinGroups', 'pins'] as const; | |||
type KindsResources = typeof kindsResources[number]; | |||
|
|||
type Request = { | |||
query: Record<KindsHashIds, Array<HashId>>; | |||
query: Partial<Record<KindsHashIds, Array<HashId>>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Talked about this on the chat with @Arinono where I voiced my concerns what we would expect if the query is optional. In this case it would mean it would return all panels, that could be fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it will mean that we give back nothing.
## [18.3.1](v18.3.0...v18.3.1) (2023-03-20) ### Bug Fixes * **chart.getPanels:** make the query params optional ([#477](#477)) ([6fc8754](6fc8754))
🎉 This PR is included in version 18.3.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
authors
@Arinono
issues
refs withthegrid/platform-client#2151
used by https://github.com/withthegrid/platform-client/pull/2152
used by https://github.com/withthegrid/platform-sdk-private/pull/281
used by https://github.com/withthegrid/platform/pull/2081
impl details
When the array is empty, the SDK strips the query param from the query, so the schema doesn't type check