Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The LUCI Authors. All rights reserved. | 1 // Copyright 2015 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package frontend | 5 package frontend |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "net/http" | 8 "net/http" |
| 9 | 9 |
| 10 "github.com/luci/luci-go/common/logging" | 10 "github.com/luci/luci-go/common/logging" |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 "Error while getting projects: "+err.Error()) | 22 "Error while getting projects: "+err.Error()) |
| 23 return | 23 return |
| 24 } | 24 } |
| 25 | 25 |
| 26 templates.MustRender(c.Context, c.Writer, "pages/config.html", templates .Args{ | 26 templates.MustRender(c.Context, c.Writer, "pages/config.html", templates .Args{ |
| 27 "Projects": projects, | 27 "Projects": projects, |
| 28 }) | 28 }) |
| 29 } | 29 } |
| 30 | 30 |
| 31 // UpdateHandler is an HTTP handler that handles configuration update requests. | 31 // UpdateHandler is an HTTP handler that handles configuration update requests. |
| 32 func UpdateHandler(ctx *router.Context) { | 32 // TODO(hinoka): Migrate to cfgclient and remove this. |
| 33 func UpdateConfigHandler(ctx *router.Context) { | |
|
hinoka
2017/03/20 20:35:49
Addressing leftover comments from the last CL
| |
| 33 c, h := ctx.Context, ctx.Writer | 34 c, h := ctx.Context, ctx.Writer |
| 34 » err := common.Update(c) | 35 » err := common.UpdateProjectConfigs(c) |
| 35 if err != nil { | 36 if err != nil { |
| 36 logging.WithError(err).Errorf(c, "Update Handler encountered err or") | 37 logging.WithError(err).Errorf(c, "Update Handler encountered err or") |
| 37 h.WriteHeader(500) | 38 h.WriteHeader(500) |
| 38 } | 39 } |
| 39 logging.Infof(c, "Successfully completed") | 40 logging.Infof(c, "Successfully completed") |
| 40 h.WriteHeader(200) | 41 h.WriteHeader(200) |
| 41 } | 42 } |
| OLD | NEW |