0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

fix: error in ssr demo when init (#9455)

This commit is contained in:
msdlisper 2023-12-18 21:28:10 +08:00 committed by GitHub
parent 8a0def2b6c
commit 1d33bcce61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,7 +2,7 @@ import { APIContext } from 'astro';
import { userCartItems } from '../../models/session';
export function GET({ cookies }: APIContext) {
let userId = cookies.get('user-id').value;
let userId = cookies.get('user-id')?.value;
if (!userId || !userCartItems.has(userId)) {
return Response.json({ items: [] });