| 159 | } |
| 160 | |
| 161 | func (s *Server) AppUpdate(c *stdapi.Context) error { |
| 162 | if err := s.hook("AppUpdateValidate", c); err != nil { |
| 163 | return err |
| 164 | } |
| 165 | |
| 166 | name := c.Var("name") |
| 167 | |
| 168 | var opts structs.AppUpdateOptions |
| 169 | if err := stdapi.UnmarshalOptions(c.Request(), &opts); err != nil { |
| 170 | return err |
| 171 | } |
| 172 | |
| 173 | err := s.provider(c).WithContext(c.Context()).AppUpdate(name, opts) |
| 174 | if err != nil { |
| 175 | return err |
| 176 | } |
| 177 | |
| 178 | return c.RenderOK() |
| 179 | } |
| 180 | |
| 181 | func (s *Server) BuildCreate(c *stdapi.Context) error { |
| 182 | if err := s.hook("BuildCreateValidate", c); err != nil { |