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) {
|
||||
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{} {
|
||||
|
|
Loading…
Reference in New Issue