remove return new HttpSuccess([]) more

This commit is contained in:
AdisakKanthawilang 2024-02-28 15:07:35 +07:00
parent bfae3e012d
commit 6642f395f0
13 changed files with 39 additions and 39 deletions

View file

@ -145,9 +145,9 @@ export class BloodGroupController extends Controller {
order: { createdAt: "ASC" },
});
if (!bloodGroup) {
return new HttpSuccess([]);
}
// if (!bloodGroup) {
// return new HttpSuccess([]);
// }
return new HttpSuccess(bloodGroup);
}
}

View file

@ -160,9 +160,9 @@ export class EducationLevelController extends Controller {
order: { createdAt: "ASC" },
});
if (!educationLevel) {
return new HttpSuccess([]);
}
// if (!educationLevel) {
// return new HttpSuccess([]);
// }
return new HttpSuccess(educationLevel);
}
}

View file

@ -44,9 +44,9 @@ export class GenderController extends Controller {
select: ["id", "name", "createdAt", "lastUpdatedAt", "createdFullName", "lastUpdateFullName"],
order: { createdAt: "ASC" },
});
if (!_gender) {
return new HttpSuccess([]);
}
// if (!_gender) {
// return new HttpSuccess([]);
// }
return new HttpSuccess(_gender);
}

View file

@ -67,9 +67,9 @@ export class OrganizationController extends Controller {
],
order: { orgRevisionCreatedAt: "DESC" },
});
if (!orgRevision) {
return new HttpSuccess([]);
}
// if (!orgRevision) {
// return new HttpSuccess([]);
// }
const mapOrgRevisions = orgRevision.map((revision) => ({
orgRevisionId: revision.id,
orgRevisionName: revision.orgRevisionName,

View file

@ -152,9 +152,9 @@ export class PosExecutiveController extends Controller {
const posExecutive = await this.posExecutiveRepository.find({
select: ["id", "posExecutiveName", "posExecutivePriority"],
});
if (!posExecutive) {
return new HttpSuccess([]);
}
// if (!posExecutive) {
// return new HttpSuccess([]);
// }
return new HttpSuccess(posExecutive);
}
}

View file

@ -247,9 +247,9 @@ export class PosLevelController extends Controller {
select: ["id", "posLevelName", "posLevelRank", "posLevelAuthority", "posTypeId"],
relations: ["posType"],
});
if (!posLevel) {
return new HttpSuccess([]);
}
// if (!posLevel) {
// return new HttpSuccess([]);
// }
const mapPosLevel = posLevel.map((item) => ({
id: item.id,
posLevelName: item.posLevelName,

View file

@ -217,9 +217,9 @@ export class PosTypeController extends Controller {
select: ["id", "posTypeName", "posTypeRank"],
relations: ["posLevels"],
});
if (!posType) {
return new HttpSuccess([]);
}
// if (!posType) {
// return new HttpSuccess([]);
// }
const mapPosType = posType.map((item) => ({
id: item.id,
posTypeName: item.posTypeName,

View file

@ -43,9 +43,9 @@ export class PrefixController extends Controller {
select: ["id", "name", "createdAt", "lastUpdatedAt", "createdFullName", "lastUpdateFullName"],
order: { createdAt: "ASC" },
});
if (!_prefix) {
return new HttpSuccess([]);
}
// if (!_prefix) {
// return new HttpSuccess([]);
// }
return new HttpSuccess(_prefix);
}

View file

@ -271,9 +271,9 @@ export class ProfileController extends Controller {
return new HttpSuccess({ data: formattedData, total: formattedData.length });
}
if (!profile) {
return new HttpSuccess([]);
}
// if (!profile) {
// return new HttpSuccess([]);
// }
const formattedData = profile.map((item) => ({
id: item.id,

View file

@ -142,9 +142,9 @@ export class ProfileSalaryController extends Controller {
// order: { createdAt: "ASC" },
});
if (!profileSalary) {
return new HttpSuccess([]);
}
// if (!profileSalary) {
// return new HttpSuccess([]);
// }
return new HttpSuccess(profileSalary);
}
}

View file

@ -144,9 +144,9 @@ export class RankController extends Controller {
order: { createdAt: "ASC" },
});
if (!rank) {
return new HttpSuccess([]);
}
// if (!rank) {
// return new HttpSuccess([]);
// }
return new HttpSuccess(rank);
}
}

View file

@ -143,9 +143,9 @@ export class RelationshipController extends Controller {
select: ["id", "name", "createdAt", "lastUpdatedAt", "createdFullName", "lastUpdateFullName"],
order: { createdAt: "ASC" },
});
if (!relationship) {
return new HttpSuccess([]);
}
// if (!relationship) {
// return new HttpSuccess([]);
// }
return new HttpSuccess(relationship);
}
}

View file

@ -144,9 +144,9 @@ export class ReligionController extends Controller {
order: { createdAt: "ASC" },
});
if (!religion) {
return new HttpSuccess([]);
}
// if (!religion) {
// return new HttpSuccess([]);
// }
return new HttpSuccess(religion);
}
}