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" }, order: { createdAt: "ASC" },
}); });
if (!bloodGroup) { // if (!bloodGroup) {
return new HttpSuccess([]); // return new HttpSuccess([]);
} // }
return new HttpSuccess(bloodGroup); return new HttpSuccess(bloodGroup);
} }
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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