From 4bb46084477c9f6fba93d84a7feea2ba63804362 Mon Sep 17 00:00:00 2001 From: Ryan Mehri Date: Sat, 9 May 2020 22:30:14 -0600 Subject: Add title to post --- backend/api/routes.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'backend/api') 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()) } -- cgit v1.2.3