Skip to content

Commit

Permalink
Change delete.go to pull request comment
Browse files Browse the repository at this point in the history
  • Loading branch information
MatRouillard committed Mar 12, 2024
1 parent 65b45a1 commit d2658c9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions vehicle/delete.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package vehicle

import (
"fmt"
"net/http"
"strconv"

Expand All @@ -27,14 +26,13 @@ func (d *DeleteHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
id, err := strconv.ParseInt(strId, 10, 64)

if err != nil {
fmt.Println("An error has occured", err)
rw.WriteHeader(http.StatusNotFound)
http.Error(rw, "Failed to parse ID", http.StatusInternalServerError)
return
}

test, err := d.store.Vehicle().Delete(r.Context(), id)
if err != nil {
fmt.Println("An error has occured", err)
http.Error(rw, "Failed to delete vehicle for the id", http.StatusInternalServerError)
return
}

Expand Down

0 comments on commit d2658c9

Please sign in to comment.