Browse Source

fixed api bug where empty fields weren't being omitted

master
Christopher Ramey 1 month ago
parent
commit
f8e429cd10
2 changed files with 4 additions and 3 deletions
  1. +1
    -0
      .gitignore
  2. +3
    -3
      pages/api.go

+ 1
- 0
.gitignore View File

@@ -1,2 +1,3 @@
*.swp
qurl
qurl.db

+ 3
- 3
pages/api.go View File

@@ -11,9 +11,9 @@ import (
)

type apijson struct {
URL string `json:"url",omitempty`
Exists bool `json:"exists",omitempty`
Error string `json:"error",omitempty`
URL string `json:"url,omitempty"`
Exists bool `json:"exists,omitempty"`
Error string `json:"error,omitempty"`
}

func (ctx *RootHandler) ServeAPI(w http.ResponseWriter, r *http.Request) {

Loading…
Cancel
Save