diff --git a/routes/api/v1/authors_add_update.go b/routes/api/v1/authors_add_update.go index b540c57..5c358fa 100644 --- a/routes/api/v1/authors_add_update.go +++ b/routes/api/v1/authors_add_update.go @@ -41,7 +41,7 @@ func AuthorAddOrUpdate(c echo.Context) error { authorID, err := strconv.ParseInt(id, 10, 64) if err != nil { - return c.JSON(http.StatusInternalServerError, models.Message{"Could not get book id."}) + return c.JSON(http.StatusBadRequest, models.Message{"Invalid ID."}) } datAuthor.ID = authorID } diff --git a/routes/api/v1/books_add_update.go b/routes/api/v1/books_add_update.go index 9233e8f..fd27a65 100644 --- a/routes/api/v1/books_add_update.go +++ b/routes/api/v1/books_add_update.go @@ -36,7 +36,7 @@ func BookAddOrUpdate(c echo.Context) error { bookID, err := strconv.ParseInt(id, 10, 64) if err != nil { - return c.JSON(http.StatusInternalServerError, models.Message{"Could not get book id."}) + return c.JSON(http.StatusBadRequest, models.Message{"Invalid ID."}) } datBook.ID = bookID } diff --git a/routes/api/v1/items_add_update.go b/routes/api/v1/items_add_update.go index 6fbb927..54e6c9e 100644 --- a/routes/api/v1/items_add_update.go +++ b/routes/api/v1/items_add_update.go @@ -36,7 +36,7 @@ func ItemAddOrUpdate(c echo.Context) error { itemID, err := strconv.ParseInt(id, 10, 64) if err != nil { - return c.JSON(http.StatusInternalServerError, models.Message{"Could not get item ID."}) + return c.JSON(http.StatusBadRequest, models.Message{"Invalid ID."}) } datItem.ID = itemID } diff --git a/routes/api/v1/publishers_add_update.go b/routes/api/v1/publishers_add_update.go index db3d2fe..8fd4656 100644 --- a/routes/api/v1/publishers_add_update.go +++ b/routes/api/v1/publishers_add_update.go @@ -37,7 +37,7 @@ func PublisherAddOrUpdate(c echo.Context) error { publisherID, err := strconv.ParseInt(id, 10, 64) if err != nil { - return c.JSON(http.StatusInternalServerError, models.Message{"Could not get item id."}) + return c.JSON(http.StatusBadRequest, models.Message{"Invalid ID."}) } datPublisher.ID = publisherID } diff --git a/routes/api/v1/user_add_update.go b/routes/api/v1/user_add_update.go index 81aa9d9..0a99700 100644 --- a/routes/api/v1/user_add_update.go +++ b/routes/api/v1/user_add_update.go @@ -43,7 +43,7 @@ func UserAddOrUpdate(c echo.Context) error { userID, err := strconv.ParseInt(id, 10, 64) if err != nil { - return c.JSON(http.StatusInternalServerError, models.Message{"Could not get item id."}) + return c.JSON(http.StatusBadRequest, models.Message{"Invalid ID."}) } datUser.ID = userID }