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) {
var c core.OAuth
if err := DecodeJSON(r, &c); err != nil {
var oauth core.OAuth
if err := DecodeJSON(r, &oauth); err != nil {
sendErrorJson(err, w, r)
return
}
app := core.App
app.OAuth = c
if err := app.Update(); err != nil {
core.App.OAuth = oauth
if err := core.App.Update(); err != nil {
sendErrorJson(err, w, r)
return
}
fmt.Println(app)
sendJsonAction(app.OAuth, "update", w, r)
sendJsonAction(core.App.OAuth, "update", w, r)
}
func apiOAuthHandler(r *http.Request) interface{} {