diff --git a/src/dtos/out/getCart.dto.ts b/src/dtos/out/getCart.dto.ts index 41f85e0..cae2f68 100644 --- a/src/dtos/out/getCart.dto.ts +++ b/src/dtos/out/getCart.dto.ts @@ -11,7 +11,9 @@ export const GetCartResultDto = Type.Object({ name: Type.String(), price: Type.Number(), discount: Type.Optional(Type.Number()), - image: Type.Optional(Type.String()) + image: Type.Optional(Type.String()), + isDiscontinued: Type.Boolean(), + isUserUploaded: Type.Boolean() }) ) }); diff --git a/src/handlers/cart.handler.ts b/src/handlers/cart.handler.ts index 02002ce..c576fdc 100644 --- a/src/handlers/cart.handler.ts +++ b/src/handlers/cart.handler.ts @@ -17,7 +17,8 @@ const get: Handler = async (req, res) => { price: true, DefaultModel: { select: { - imageUrl: true + imageUrl: true, + isDiscontinued: true } }, ModelPromotion: { @@ -42,7 +43,9 @@ const get: Handler = async (req, res) => { id: item.model.id, name: item.model.name, price: item.model.price, - quantity: item.quantity + quantity: item.quantity, + isDiscontinued: item.model.DefaultModel?.isDiscontinued || false, + isUserUploaded: item.model.DefaultModel !== undefined })) }; } catch (e) {