Skip to content

Commit

Permalink
fix typo and add some field and include some model to query of return…
Browse files Browse the repository at this point in the history
… comments for product
  • Loading branch information
bahram1249 committed Jun 19, 2024
1 parent c7d2213 commit 49922dc
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions apps/e-commerce/src/product-comment/product-comment.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,24 @@ export class ProductCommentService {
])
.include([
{
attributes: ['id', 'description'],
attributes: [
'id',
'description',
'statusId',
'createdAt',
'updatedAt',
],
model: ECProductComment,
as: 'replies',
required: false,
include: [
{
attributes: ['id', 'name'],
model: ECProductCommentStatus,
as: 'status',
required: false,
},
],
},
{
attributes: ['id', 'name'],
Expand All @@ -128,7 +142,7 @@ export class ProductCommentService {
required: false,
},
{
attributes: ['id', 'commnetId', 'factorId', 'score'],
attributes: ['id', 'commentId', 'factorId', 'score'],
model: ECProductCommentFactor,
as: 'commentFactors',
include: [
Expand All @@ -141,6 +155,12 @@ export class ProductCommentService {
],
required: false,
},
{
attributes: ['id', 'firstname', 'lastname'],
model: User,
as: 'user',
required: false,
},
])
.offset(filter.offset)
.limit(filter.limit)
Expand Down

0 comments on commit 49922dc

Please sign in to comment.