Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

fix(chart.getPanels): make the query params optional #477

Merged
merged 6 commits into from
Mar 20, 2023

Conversation

Arinono
Copy link
Contributor

@Arinono Arinono commented Mar 20, 2023

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

@Arinono Arinono requested a review from NickdeK March 20, 2023 13:16
@@ -22,10 +22,10 @@ type Panel = {
};

type Request = {
body: Record<KindsResources, Array<{
body: Partial<Record<KindsResources, Array<{
Copy link
Contributor

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?

Copy link
Collaborator

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>>>;
Copy link
Contributor

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?

Copy link
Collaborator

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.

@Arinono Arinono merged commit 6fc8754 into main Mar 20, 2023
@Arinono Arinono deleted the fix-platform-client-2151-sentry-error-preserve-graphs branch March 20, 2023 18:45
github-actions bot pushed a commit that referenced this pull request Mar 20, 2023
## [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))
@github-actions
Copy link

🎉 This PR is included in version 18.3.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants