fix: autopopulate note

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei
2023-04-25 21:24:43 +08:00
parent 1ce63221b6
commit 040856e57b

View File

@@ -82,7 +82,10 @@ export class DatabaseService {
public async findGlobalById(id: string) {
const doc = await Promise.all([
this.postModel.findById(id).populate('category').lean(),
this.noteModel.findById(id).lean().select('+password'),
this.noteModel
.findById(id)
.lean({ autopopulate: true })
.select('+password'),
this.pageModel.findById(id).lean(),
this.recentlyModel.findById(id).lean(),
])