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

Rollup property response does not match type #427

Closed
rhinodavid opened this issue Jul 21, 2023 · 0 comments · Fixed by #439
Closed

Rollup property response does not match type #427

rhinodavid opened this issue Jul 21, 2023 · 0 comments · Fixed by #439

Comments

@rhinodavid
Copy link

Screenshot 2023-07-20 at 5 45 45 PM

I have a Rollup property in a database that points to a Number property with the "Show original" calculate strategy.

The relevant portion of the Page response follows:

  "Chain ID": {
      "id": "ej%40%3A",
      "type": "rollup",
      "rollup": {
          "type": "array",
          "array": [
              {
                  "type": "number",
                  "number": 42161
              }
          ],
          "function": "show_original"
      }
  }

In api-endpoints.d.ts, as of v2.2.8 the relevant portion of PageObjectResponse is:

{
        type: "rollup";
        rollup: {
            type: "number";
            number: number | null;
            function: RollupFunction;
        } | {
            type: "date";
            date: DateResponse | null;
            function: RollupFunction;
        } | {
            type: "array";
            array: Array<{
                type: "title";
                title: Array<RichTextItemResponse>;
            } | {
                type: "rich_text";
                rich_text: Array<RichTextItemResponse>;
            } | {
                type: "people";
                people: Array<PartialUserObjectResponse | UserObjectResponse>;
            } | {
                type: "relation";
                relation: Array<{
                    id: string;
                }>;
            }>;
            function: RollupFunction;
        };
        id: string;
    }

As you can see, the "array" property doesn't have a union member where type: "number".

Am I missing something here?

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 a pull request may close this issue.

1 participant