6 Commits

Author SHA1 Message Date
miguel e811f67c07 Add ordering to findAll methods in Adscripcion, Categoria, and Edificio services 2025-06-04 10:44:53 -06:00
TheManus88 08aade7dcd paginated 2024-10-24 20:26:40 -06:00
TheManus88 f04f01a39c Merge remote-tracking branch 'origin/Lino' into development 2024-10-14 17:48:25 -06:00
TheManus88 82550eefcc Merge remote-tracking branch 'origin/Lino' into development 2024-07-30 22:22:32 -06:00
TheManus88 c9f883de3c merge into Lino 2024-07-29 19:51:30 -06:00
TheManus88 a23ba6da18 remove db fields and change idprofresor by no autoincremental id 2024-07-25 08:55:18 -06:00
4 changed files with 9 additions and 5 deletions
+2 -2
View File
@@ -57,11 +57,11 @@ export class ProfesorController {
}
@Get("page")
findAllPaginated(@Query("page") page: number = 1, @Query("limit") limit: number = 10, @Query() filters: any) {
findAllPaginated(@Query("page") page: number = 1, @Query("limit") limit: number = 12, @Query() filters: any) {
try {
Logger.debug("Page Profesors");
page = page < 1 ? 1 : page;
limit = limit > 10 || limit < 1 ? 10 : limit;
limit = limit > 12 || limit < 1 ? 12 : limit;
return this.profesorService.findAllPaginated(page, limit, filters);
} catch (err) {
Logger.error("profesor controller ", err.error);
+3 -1
View File
@@ -11,6 +11,8 @@ export class AdscripcionService {
) {}
async findAll(): Promise<Adscripcion[]> {
return this.adscripcionRepository.find();
return this.adscripcionRepository.find({
order: { adscripcion: 'ASC' }, // Change 'adscripcion' to your desired column for ordering
});
}
}
+1 -1
View File
@@ -11,6 +11,6 @@ export class CategoriaService {
) {}
async findAll(): Promise<Categoria[]> {
return this.categoriaRepository.find();
return this.categoriaRepository.find({ order: { categoria: 'ASC' } });
}
}
+3 -1
View File
@@ -11,6 +11,8 @@ export class EdificioService {
) {}
async findAll(): Promise<Edificio[]> {
return this.categoriaRepository.find();
return this.categoriaRepository.find({
order: { edificio: 'ASC' }, // Change 'edificio' to your desired column for ordering
});
}
}