add: sort data

This commit is contained in:
Julian Krauser 2025-01-12 18:17:54 +01:00
parent 1c6c123142
commit 03036c8b77
17 changed files with 19 additions and 0 deletions

View file

@ -12,6 +12,7 @@ export default abstract class CalendarService {
.getRepository(calendar)
.createQueryBuilder("calendar")
.leftJoinAndSelect("calendar.type", "type")
.orderBy("starttime", "ASC")
.getMany()
.then((res) => {
return res;

View file

@ -16,6 +16,7 @@ export default abstract class CommunicationService {
.leftJoinAndSelect("communication.member", "member")
.leftJoinAndSelect("member.sendNewsletter", "sendNewsletter")
.where("communication.memberId = :memberId", { memberId: memberId })
.orderBy("communicationType.type", "ASC")
.getMany()
.then((res) => {
return res;

View file

@ -14,6 +14,7 @@ export default abstract class MemberAwardService {
.createQueryBuilder("memberAwards")
.leftJoinAndSelect("memberAwards.award", "award")
.where("memberAwards.memberId = :memberId", { memberId: memberId })
.orderBy("award.award", "ASC")
.getMany()
.then((res) => {
return res;

View file

@ -14,6 +14,8 @@ export default abstract class MemberExecutivePositionService {
.createQueryBuilder("memberExecutivePositions")
.leftJoinAndSelect("memberExecutivePositions.executivePosition", "executivePosition")
.where("memberExecutivePositions.memberId = :memberId", { memberId: memberId })
.orderBy("executivePosition.position", "ASC")
.addOrderBy("memberExecutivePositions.start", "DESC")
.getMany()
.then((res) => {
return res;

View file

@ -14,6 +14,7 @@ export default abstract class MemberQualificationService {
.createQueryBuilder("memberQualifications")
.leftJoinAndSelect("memberQualifications.qualification", "qualification")
.where("memberQualifications.memberId = :memberId", { memberId: memberId })
.orderBy("qualification.qualification", "ASC")
.getMany()
.then((res) => {
return res;

View file

@ -12,6 +12,7 @@ export default abstract class AwardService {
return await dataSource
.getRepository(award)
.createQueryBuilder("award")
.orderBy("award", "ASC")
.getMany()
.then((res) => {
return res;

View file

@ -11,6 +11,7 @@ export default abstract class CalendarTypeService {
return await dataSource
.getRepository(calendarType)
.createQueryBuilder("calendarType")
.orderBy("type", "ASC")
.getMany()
.then((res) => {
return res;

View file

@ -11,6 +11,7 @@ export default abstract class CommunicationTypeService {
return await dataSource
.getRepository(communicationType)
.createQueryBuilder("communicationType")
.orderBy("type", "ASC")
.getMany()
.then((res) => {
return res;

View file

@ -12,6 +12,7 @@ export default abstract class ExecutivePositionService {
return await dataSource
.getRepository(executivePosition)
.createQueryBuilder("executivePosition")
.orderBy("position", "ASC")
.getMany()
.then((res) => {
return res;

View file

@ -12,6 +12,7 @@ export default abstract class MembershipStatusService {
return await dataSource
.getRepository(membershipStatus)
.createQueryBuilder("membershipStatus")
.orderBy("status", "ASC")
.getMany()
.then((res) => {
return res;

View file

@ -13,6 +13,7 @@ export default abstract class NewsletterConfigService {
.getRepository(newsletterConfig)
.createQueryBuilder("newsletterConfig")
.leftJoinAndSelect("newsletterConfig.comType", "comType")
.orderBy("comType.type", "ASC")
.getMany()
.then((res) => {
return res;

View file

@ -13,6 +13,7 @@ export default abstract class QualificationService {
return await dataSource
.getRepository(qualification)
.createQueryBuilder("qualification")
.orderBy("qualification", "ASC")
.getMany()
.then((res) => {
return res;

View file

@ -11,6 +11,7 @@ export default abstract class QueryStoreService {
return await dataSource
.getRepository(query)
.createQueryBuilder("queryStore")
.orderBy("title", "ASC")
.getMany()
.then((res) => {
return res;

View file

@ -12,6 +12,7 @@ export default abstract class TemplateService {
return await dataSource
.getRepository(template)
.createQueryBuilder("template")
.orderBy("template", "ASC")
.getMany()
.then((res) => {
return res;

View file

@ -14,6 +14,7 @@ export default abstract class TemplateUsageService {
.leftJoinAndSelect("templateUsage.header", "headerTemplate")
.leftJoinAndSelect("templateUsage.body", "bodyTemplate")
.leftJoinAndSelect("templateUsage.footer", "footerTemplate")
.orderBy("scope", "ASC")
.getMany()
.then((res) => {
return res;

View file

@ -12,6 +12,7 @@ export default abstract class RoleService {
.getRepository(role)
.createQueryBuilder("role")
.leftJoinAndSelect("role.permissions", "role_permissions")
.orderBy("role", "ASC")
.getMany()
.then((res) => {
return res;

View file

@ -15,6 +15,8 @@ export default abstract class UserService {
.leftJoinAndSelect("user.roles", "roles")
.leftJoinAndSelect("user.permissions", "permissions")
.leftJoinAndSelect("roles.permissions", "role_permissions")
.orderBy("firstname", "ASC")
.addOrderBy("lastname", "ASC")
.getMany()
.then((res) => {
return res;