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

fixed APIRoute type #3365

Merged
merged 2 commits into from
May 31, 2022
Merged

fixed APIRoute type #3365

merged 2 commits into from
May 31, 2022

Conversation

RafidMuhymin
Copy link
Member

@RafidMuhymin RafidMuhymin commented May 13, 2022

Fixes #3343

Changes

Fixed APIRoute type.

Testing

This change was tested locally.

Docs

@changeset-bot
Copy link

changeset-bot bot commented May 13, 2022

⚠️ No Changeset found

Latest commit: 4a2c2dc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label May 13, 2022

export interface EndpointHandler {
[method: string]: APIRoute | ((params: Params, request: Request) => EndpointOutput | Response);
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason for changing this? This is needed for supporting the deprecated 2 param API.

Copy link
Member Author

Choose a reason for hiding this comment

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

But aren't both of the types the same?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, that's why the build is failing. The second type takes two parameters. The APIRoute signature just takes the one.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops! Sorry! Didn't even realize!

@matthewp
Copy link
Contributor

Whoops, closed by mistake.

@matthewp matthewp reopened this May 17, 2022
@matthewp matthewp merged commit 0ead51a into withastro:main May 31, 2022
SiriousHunter pushed a commit to SiriousHunter/astro that referenced this pull request Feb 3, 2023
* fixed APIRoute type

* fixed EndpointHandler type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 BUG: APIRoute type problems
2 participants