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

docs: fix arguments in experimental.actions code example #11008

Merged
merged 1 commit into from May 13, 2024

Conversation

k1350
Copy link
Contributor

@k1350 k1350 commented May 11, 2024

Changes

fix arguments in experimental.actions code example

Testing

Docs

Copy link

changeset-bot bot commented May 11, 2024

⚠️ No Changeset found

Latest commit: a569ccd

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.

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 pkg: astro Related to the core `astro` package (scope) docs pr A PR that includes documentation for review labels May 11, 2024
@ematipico
Copy link
Member

Since it's an example, I believe that was intentional: to show that context is the second argument

@k1350
Copy link
Contributor Author

k1350 commented May 11, 2024

@ematipico Thank you for your comment.

I saw the following commit to the Actions RFC
withastro/roadmap@163b540

and checked type Handler

type Handler<TInputSchema, TOutput> = TInputSchema extends z.ZodType

then thought the second argument was deleted.

My mistake if the second argument still exists.

@k1350
Copy link
Contributor Author

k1350 commented May 13, 2024

@bholmesdev I appreciate if you could help me. Is Astro API context still provided as the second argument of Astro actions handler?

@bholmesdev
Copy link
Contributor

@k1350 Ah, this has been changed to a getApiContext() helper! You can call this function within your action handler to access the context. See here: https://github.com/withastro/roadmap/blob/actions/proposals/0046-actions.md#access-api-context

@bholmesdev bholmesdev closed this May 13, 2024
@bholmesdev bholmesdev reopened this May 13, 2024
Copy link
Contributor

@bholmesdev bholmesdev left a comment

Choose a reason for hiding this comment

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

Thanks for catching this! Missed a spot it seems

@bholmesdev bholmesdev merged commit dec82d5 into withastro:main May 13, 2024
27 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs pr A PR that includes documentation for review pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants