0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-06 22:10:10 -05:00
astro/.changeset/six-icons-pump.md

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
463 B
Markdown
Raw Normal View History

---
"astro": patch
---
Deprecate the `getApiContext()` function. API Context can now be accessed from the second parameter to your Action `handler()`:
```diff
// src/actions/index.ts
import {
defineAction,
z,
- getApiContext,
} from 'astro:actions';
export const server = {
login: defineAction({
input: z.object({ id: z.string }),
+ handler(input, context) {
const user = context.locals.auth(input.id);
return user;
}
}),
}
```