Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

Commit

Permalink
Fixed Lint Error
Browse files Browse the repository at this point in the history
  • Loading branch information
Medzik authored and Medzik committed Jul 14, 2021
1 parent deca657 commit 94b0a80
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config/version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package config

var Version = "1.0.0-beta.3"
var Version = "1.0.0"
3 changes: 0 additions & 3 deletions website/routes/api/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ import (
)

func Delete(c *gin.Context) {
var post URLType
c.BindJSON(&post)

url := c.Param("url")

d, err := base64.StdEncoding.DecodeString(url)
Expand Down
12 changes: 10 additions & 2 deletions website/routes/api/insert.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ import (

func Insert(c *gin.Context) {
var post URLType
c.BindJSON(&post)
err := c.BindJSON(&post)
if err != nil {
c.JSON(http.StatusBadRequest, gin.H{
"success": false,
"message": "Error Binding JSON!",
})

return
}

if len(post.URL) < 1 {
c.JSON(http.StatusBadRequest, gin.H{
Expand All @@ -20,7 +28,7 @@ func Insert(c *gin.Context) {
return
}

_, err := http.Get(post.URL)
_, err = http.Get(post.URL)
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{
"success": false,
Expand Down

0 comments on commit 94b0a80

Please sign in to comment.