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:
parent
8a0def2b6c
commit
1d33bcce61
1 changed files with 1 additions and 1 deletions
|
@ -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: [] });
|
||||
|
|
Loading…
Reference in a new issue