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.' });
|
res.status(400).json({ error: 'Product id is required.' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let cart: ICart = await Cart.findOne({ userId });
|
let cart: ICart | null = await Cart.findOne({ userId });
|
||||||
if (!cart) {
|
if (!cart) {
|
||||||
cart = await Cart.create({
|
cart = await Cart.create({
|
||||||
userId,
|
userId,
|
||||||
|
|
Loading…
Reference in a new issue