Skip to content

Commit

Permalink
Merge pull request #207 from Roger13579/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Roger13579 authored Jun 12, 2024
2 parents ecd8d1c + 7901f6f commit add29e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/repository/cartRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class CartRepository {
$elemMatch: this.itemElemMath(item),
},
};
return await CartModel.findOneAndUpdate(
return CartModel.findOneAndUpdate(
filter,
{
$pull: {
Expand Down
8 changes: 7 additions & 1 deletion src/types/cart.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import {
import { IProduct } from '../models/product';
import { ICart, IItem } from '../models/cart';
import { IUserId } from './user.type';
import { Types } from 'mongoose';
import { IPlan } from './product.type';

export enum EditCartType {
inc = 'inc',
Expand Down Expand Up @@ -47,7 +49,6 @@ interface ICartPaginationItem extends ITimestamp {
| 'isLaunched'
| 'photoPath'
| 'sellEndAt'
| 'sellEndAt'
>;
amount: number;
}
Expand Down Expand Up @@ -77,6 +78,11 @@ export interface IDeleteCartReq extends IUserReq {
};
}

export interface IDeleteCartItem extends ICartProduct {
productId: Types.ObjectId;
plan: IPlan;
}

export interface IEditCartItem extends Pick<IItem, 'amount'>, ICartProduct {
type: EditCartType;
}
Expand Down

0 comments on commit add29e3

Please sign in to comment.