From 4c16b26657d974c3ffce35a1caddebb1bf2a35e9 Mon Sep 17 00:00:00 2001 From: Innei Date: Fri, 10 Dec 2021 12:00:39 +0800 Subject: [PATCH] fix: poplaute `category` field in comment list --- src/modules/comment/comment.service.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/modules/comment/comment.service.ts b/src/modules/comment/comment.service.ts index c6011fd8..96ae464f 100644 --- a/src/modules/comment/comment.service.ts +++ b/src/modules/comment/comment.service.ts @@ -182,7 +182,12 @@ export class CommentService { limit: size, populate: [ { path: 'parent', select: '-children' }, - { path: 'ref', select: 'title _id slug nid' }, + { + path: 'ref', + select: 'title _id slug nid categoryId', + + populate: [{ path: 'category', model: 'Category' }], + }, ], sort: { created: -1 }, },