mirror of https://github.com/statping/statping
code clean
parent
08e5d81c3c
commit
d9a5aa84fa
|
@ -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{} {
|
||||||
|
|
Loading…
Reference in New Issue