-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove remaining simple objects usage (#9266)
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
- Loading branch information
1 parent
7cf5e75
commit ac41820
Showing
5 changed files
with
11 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
import { APIContext, APIRoute } from 'astro'; | ||
|
||
export const post: APIRoute = ({ cookies, params, request }: APIContext) => { | ||
export const POST: APIRoute = ({ cookies }: APIContext) => { | ||
// add a new cookie | ||
cookies.set('user-id', '1', { | ||
path: '/', | ||
maxAge: 2592000, | ||
}); | ||
|
||
return { | ||
body: JSON.stringify({ | ||
ok: true, | ||
user: 1, | ||
}), | ||
}; | ||
return Response.json({ | ||
ok: true, | ||
user: 1, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
packages/astro/test/fixtures/ssr-api-route-custom-404/src/pages/api/route.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
|
||
export function POST() { | ||
return { | ||
body: JSON.stringify({ ok: true }) | ||
}; | ||
return Response.json({ ok: true }); | ||
} |