code clean

pull/702/head
hunterlong 2020-06-25 21:51:51 -07:00
parent 08e5d81c3c
commit d9a5aa84fa
1 changed files with 5 additions and 8 deletions

View File

@ -45,22 +45,19 @@ func apiRenewHandler(w http.ResponseWriter, r *http.Request) {
} }
func apiUpdateOAuthHandler(w http.ResponseWriter, r *http.Request) { func apiUpdateOAuthHandler(w http.ResponseWriter, r *http.Request) {
var c core.OAuth var oauth core.OAuth
if err := DecodeJSON(r, &c); err != nil { if err := DecodeJSON(r, &oauth); err != nil {
sendErrorJson(err, w, r) sendErrorJson(err, w, r)
return return
} }
app := core.App core.App.OAuth = oauth
app.OAuth = c if err := core.App.Update(); err != nil {
if err := app.Update(); err != nil {
sendErrorJson(err, w, r) sendErrorJson(err, w, r)
return return
} }
fmt.Println(app) sendJsonAction(core.App.OAuth, "update", w, r)
sendJsonAction(app.OAuth, "update", w, r)
} }
func apiOAuthHandler(r *http.Request) interface{} { func apiOAuthHandler(r *http.Request) interface{} {