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