diff options
| author | Jacky Zhao <[email protected]> | 2020-05-09 21:32:42 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-05-09 21:32:42 -0700 |
| commit | 11dbd79c57ec1cd08f4753f5c5cc269db9317f5a (patch) | |
| tree | 1beda0f732febffec221b1d372b1dc75167900b1 /backend/api/routes.go | |
| parent | Merge pull request #5 from jackyzha0/react (diff) | |
| parent | Add title to post (diff) | |
| download | ctrl-v-11dbd79c57ec1cd08f4753f5c5cc269db9317f5a.tar.xz ctrl-v-11dbd79c57ec1cd08f4753f5c5cc269db9317f5a.zip | |
Merge pull request #6 from jackyzha0/backend
Add title to post
Diffstat (limited to 'backend/api/routes.go')
| -rw-r--r-- | backend/api/routes.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/backend/api/routes.go b/backend/api/routes.go index 760ee35..ef8ccf7 100644 --- a/backend/api/routes.go +++ b/backend/api/routes.go @@ -22,6 +22,7 @@ func insertFunc(w http.ResponseWriter, r *http.Request) { _ = r.ParseMultipartForm(0) expiry := r.FormValue("expiry") content := r.FormValue("content") + title := r.FormValue("title") // get ip ip := getIP(r) @@ -29,7 +30,7 @@ func insertFunc(w http.ResponseWriter, r *http.Request) { log.Infof("got content '%s' and ip '%s'", content, ip) // insert content - err := db.New(ip, content, expiry) + err := db.New(ip, content, expiry, title) if err != nil { fmt.Fprintf(w, "got err: %s", err.Error()) } |