Skip to content

Changes endpoints.mdx#3950

Merged
sarah11918 merged 2 commits into
withastro:mainfrom
hvlxh:patch-2
Aug 7, 2023
Merged

Changes endpoints.mdx#3950
sarah11918 merged 2 commits into
withastro:mainfrom
hvlxh:patch-2

Conversation

@hvlxh
Copy link
Copy Markdown
Contributor

@hvlxh hvlxh commented Jul 30, 2023

It will not work because assigning function in variable should be an callback () => {} not but using function keyword function example()

It will not work because assigning function in variable should be an callback `() => {}` not but using function keyword `function example()`
@netlify
Copy link
Copy Markdown

netlify Bot commented Jul 30, 2023

Deploy Preview for astro-docs-2 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 86b8e0f
🔍 Latest deploy log https://app.netlify.com/sites/astro-docs-2/deploys/64d0cd71fff90a000898e99b
😎 Deploy Preview https://deploy-preview-3950--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@hvlxh
Copy link
Copy Markdown
Contributor Author

hvlxh commented Jul 30, 2023

We are also able to do like this:

export async function get({ params, request }): APIRoute {
...

@Alynva
Copy link
Copy Markdown
Contributor

Alynva commented Jul 30, 2023

WDYM? That does work, look this

image

@TheOtterlord
Copy link
Copy Markdown
Member

Thanks for the PR!
The existing pattern is valid syntax known as a function expression, and will work fine in an endpoint. Looking at the rest of the file, we are mixing this and arrow function syntax, so this might be an opportunity to make our examples on this page more consistent.

@sarah11918 sarah11918 added improve or update documentation Enhance / update existing documentation (e.g. add example, improve description, update for changes) should this be documented? Need to figure out whether this is something to add to documentation or not labels Jul 31, 2023
Copy link
Copy Markdown
Member

@sarah11918 sarah11918 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 this, @hvlxh! As others have pointed out, it brings a consistency to the page that can only be helpful for readers. Welcome to Team Docs! 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improve or update documentation Enhance / update existing documentation (e.g. add example, improve description, update for changes) should this be documented? Need to figure out whether this is something to add to documentation or not

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants