mirror of https://github.com/fantasticit/think.git
server: fix get version data
parent
c1db90aa21
commit
62839b1ff3
|
@ -23,11 +23,14 @@ export class DocumentVersionService {
|
|||
|
||||
private async withUser(data: Array<Omit<VerisonDataItem, 'createUser'>>): Promise<VerisonDataItem[]> {
|
||||
return await Promise.all(
|
||||
data.filter(Boolean).map(async (record) => {
|
||||
const { userId } = record;
|
||||
const createUser = await this.userService.findById(userId);
|
||||
return { ...record, createUser };
|
||||
})
|
||||
data
|
||||
.filter(Boolean)
|
||||
.filter((record) => record.userId)
|
||||
.map(async (record) => {
|
||||
const { userId } = record;
|
||||
const createUser = await this.userService.findById(userId);
|
||||
return { ...record, createUser };
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue