diff options
| author | Ryan Mehri <[email protected]> | 2020-05-17 11:03:24 -0600 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-05-17 11:03:24 -0600 |
| commit | 3fb2647699bc1a57f718d384860cf2279fa8222e (patch) | |
| tree | 48d6eb2adeef0c9058734e5941fb7fddfc031bb4 /backend/api | |
| parent | Merge pull request #26 from jackyzha0/raw-button (diff) | |
| parent | remove lang input (diff) | |
| download | ctrl-v-3fb2647699bc1a57f718d384860cf2279fa8222e.tar.xz ctrl-v-3fb2647699bc1a57f718d384860cf2279fa8222e.zip | |
Merge pull request #27 from jackyzha0/save-lang
save lang
Diffstat (limited to 'backend/api')
| -rw-r--r-- | backend/api/routes.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/backend/api/routes.go b/backend/api/routes.go index 26c932f..d05e99a 100644 --- a/backend/api/routes.go +++ b/backend/api/routes.go @@ -28,12 +28,13 @@ func insertFunc(w http.ResponseWriter, r *http.Request) { content := r.FormValue("content") title := r.FormValue("title") password := r.FormValue("password") + lang := r.FormValue("language") // get ip ip := getIP(r) // insert content - hash, err := db.New(ip, content, expiry, title, password) + hash, err := db.New(ip, content, expiry, title, password, lang) if err != nil { w.WriteHeader(http.StatusBadRequest) fmt.Fprintf(w, "%s", err.Error()) @@ -99,6 +100,7 @@ func handleGetPaste(w http.ResponseWriter, r *http.Request, parsedPassword strin "title": paste.Title, "content": paste.Content, "expiry": paste.Expiry, + "language": paste.Language, } jsonData, _ := json.Marshal(pasteMap) |