diff options
author | Matthew Lemon <y@yulqen.org> | 2024-03-11 19:01:55 +0000 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-03-11 19:01:55 +0000 |
commit | 10a9c0bc1b6287d69e13126a85708322a26e0bef (patch) | |
tree | 57d390c946794730c652504ca98789b01f8ef4df | |
parent | 86c012d7a7155ba3f935897e00f594a6bac9786a (diff) |
Handles negative id
-rw-r--r-- | cmd/api/datamaps.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/cmd/api/datamaps.go b/cmd/api/datamaps.go index 53f08bf..517d82d 100644 --- a/cmd/api/datamaps.go +++ b/cmd/api/datamaps.go @@ -14,8 +14,7 @@ func (app *application) showDatamapHandler(w http.ResponseWriter, r *http.Reques id := r.PathValue("id") app.logger.Info("the id requested", "id", id) id_int, err := strconv.ParseInt(id, 10, 64) - // TODO: Handle negative integers passed in the URL here - if err != nil { + if err != nil || id_int < 1 { http.NotFound(w, r) return } |