mirror of https://github.com/fantasticit/think.git
server: fix response with createUser
This commit is contained in:
parent
1d0356d4f5
commit
2a3bedcbfe
|
@ -130,14 +130,14 @@ export class TemplateService {
|
||||||
query.take(+pageSize);
|
query.take(+pageSize);
|
||||||
const [data, count] = await query.getManyAndCount();
|
const [data, count] = await query.getManyAndCount();
|
||||||
|
|
||||||
await Promise.all(
|
const ret = await Promise.all(
|
||||||
data.map(async (template) => {
|
data.map(async (template) => {
|
||||||
const createUser = await this.userService.findById(template.createUserId);
|
const createUser = await this.userService.findById(template.createUserId);
|
||||||
return { ...template, createUser };
|
return { ...template, createUser };
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
return { data, total: count };
|
return { data: ret, total: count };
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -156,13 +156,13 @@ export class TemplateService {
|
||||||
query.take(+pageSize);
|
query.take(+pageSize);
|
||||||
const [data, count] = await query.getManyAndCount();
|
const [data, count] = await query.getManyAndCount();
|
||||||
|
|
||||||
await Promise.all(
|
const ret = await Promise.all(
|
||||||
data.map(async (template) => {
|
data.map(async (template) => {
|
||||||
const createUser = await this.userService.findById(template.createUserId);
|
const createUser = await this.userService.findById(template.createUserId);
|
||||||
return { ...template, createUser };
|
return { ...template, createUser };
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
return { data, total: count };
|
return { data: ret, total: count };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue