From 13dfe781218ef797dab04b2c8a8cbdbecf8462bf Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 15 May 2025 09:50:33 +0200 Subject: [PATCH] fix(project): correctly handle invalid project id error --- pkg/routes/api/v1/user_list.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/routes/api/v1/user_list.go b/pkg/routes/api/v1/user_list.go index afeb54938..348d4df8d 100644 --- a/pkg/routes/api/v1/user_list.go +++ b/pkg/routes/api/v1/user_list.go @@ -21,6 +21,7 @@ import ( "strconv" "code.vikunja.io/api/pkg/db" + "code.vikunja.io/api/pkg/web" "code.vikunja.io/api/pkg/models" auth2 "code.vikunja.io/api/pkg/modules/auth" @@ -84,7 +85,10 @@ func UserList(c echo.Context) error { func ListUsersForProject(c echo.Context) error { projectID, err := strconv.ParseInt(c.Param("project"), 10, 64) if err != nil { - return handler.HandleHTTPError(err) + return c.JSON(http.StatusBadRequest, map[string]interface{}{ + "message": "Invalid project ID", + "details": err.Error(), + }) } project := models.Project{ID: projectID}