Skip to content

Commit

Permalink
Rename slug var to id on responses
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick-Isidoro authored and ecanuto committed Aug 20, 2020
1 parent 7f4d8ac commit 9f51f36
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ func main() {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
slug, err := store.Set(data.URL)
id, err := store.Set(data.URL)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}

c.JSON(http.StatusOK, gin.H{"id": slug, "link": address + slug})
c.JSON(http.StatusOK, gin.H{"id": id, "link": address + id})
})
log.Fatal(r.Run(port))
}

0 comments on commit 9f51f36

Please sign in to comment.