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) .getRepository(calendar)
.createQueryBuilder("calendar") .createQueryBuilder("calendar")
.leftJoinAndSelect("calendar.type", "type") .leftJoinAndSelect("calendar.type", "type")
.orderBy("starttime", "ASC")
.getMany() .getMany()
.then((res) => { .then((res) => {
return res; return res;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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