fix bug
This commit is contained in:
parent
c9c4d86f6a
commit
5cb9bd2372
1 changed files with 14 additions and 0 deletions
|
|
@ -240,6 +240,13 @@ export class kpiLinkController extends Controller {
|
|||
)
|
||||
.getManyAndCount();
|
||||
|
||||
if (_total === 0) {
|
||||
return new HttpSuccess({
|
||||
data: [],
|
||||
total: 0,
|
||||
});
|
||||
}
|
||||
|
||||
const [kpiLink, total] = await AppDataSource.getRepository(KpiLink)
|
||||
.createQueryBuilder("kpiLink")
|
||||
.leftJoinAndSelect("kpiLink.kpiGroup", "kpiGroup")
|
||||
|
|
@ -253,6 +260,13 @@ export class kpiLinkController extends Controller {
|
|||
.orderBy("kpiLink.createdAt", "ASC")
|
||||
.getManyAndCount();
|
||||
|
||||
if (_total === 0) {
|
||||
return new HttpSuccess({
|
||||
data: [],
|
||||
total: 0,
|
||||
});
|
||||
}
|
||||
|
||||
const formattedResponse = kpiLink.map((item) => ({
|
||||
id: item.id,
|
||||
groupName: item.kpiGroup.nameGroupKPI,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue