mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-08-03 02:09:15 +02:00
fix:#150 fixed return
This commit is contained in:
@@ -3,6 +3,7 @@ package room
|
||||
import (
|
||||
"htwkalender/model"
|
||||
"htwkalender/service/db"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
|
||||
"github.com/labstack/echo/v5"
|
||||
@@ -13,7 +14,8 @@ func GetRooms(c echo.Context, app *pocketbase.PocketBase) error {
|
||||
rooms, err := db.GetRooms(app)
|
||||
|
||||
if err != nil {
|
||||
return c.JSON(http.StatusNotFound, err)
|
||||
slog.Error("Error getting rooms: ", err)
|
||||
return c.JSON(http.StatusNotFound, "No rooms found")
|
||||
} else {
|
||||
return c.JSON(http.StatusOK, rooms)
|
||||
}
|
||||
|
Reference in New Issue
Block a user