Add route to get a particular book
This commit is contained in:
@@ -25,7 +25,7 @@ func ValidateId(db *gorm.DB, id uint, value any) error {
|
||||
}
|
||||
if errors.Is(result.Error, gorm.ErrRecordNotFound) {
|
||||
return HttpError{
|
||||
StatusCode: http.StatusBadRequest,
|
||||
StatusCode: http.StatusNotFound,
|
||||
Err: fmt.Errorf("Id %d could not be found for model %s", id, value),
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user