fixing typescript issue
This commit is contained in:
parent
a517def07d
commit
5505f8e2be
1 changed files with 1 additions and 1 deletions
|
@ -12,7 +12,7 @@ export async function addToCart(req: Request, res: Response) {
|
|||
res.status(400).json({ error: 'Product id is required.' });
|
||||
return;
|
||||
}
|
||||
let cart: ICart = await Cart.findOne({ userId });
|
||||
let cart: ICart | null = await Cart.findOne({ userId });
|
||||
if (!cart) {
|
||||
cart = await Cart.create({
|
||||
userId,
|
||||
|
|
Loading…
Reference in a new issue