Sortiere Sprechstunden und Räume alphabetisch

This commit is contained in:
Gonne 2022-09-26 14:25:51 +02:00
parent d28d3e21ee
commit 6241c8f391
2 changed files with 2 additions and 2 deletions

View file

@ -28,7 +28,7 @@ func (r *CourseRepo) FindById(id int) (models.Course, error) {
}
func (r *CourseRepo) GetAll() ([]models.Course, error) {
rows, err := r.db.Query("SELECT * FROM course")
rows, err := r.db.Query("SELECT * FROM course ORDER BY name ASC")
if err != nil {
log.Printf("Error getting all courses: %s", err.Error())
return nil, err

View file

@ -42,7 +42,7 @@ func (r *RoomRepo) FindById(id int) (models.Room, error) {
}
func (r *RoomRepo) GetAll() ([]models.Room, error) {
rows, err := r.db.Query("SELECT * FROM room")
rows, err := r.db.Query("SELECT * FROM room ORDER BY name ASC")
if err != nil {
err = fmt.Errorf("Error getting all rooms: %w", err)
log.Println(err.Error())