(c *stdapi.Context)
| 179 | } |
| 180 | |
| 181 | func (s *Server) BuildCreate(c *stdapi.Context) error { |
| 182 | if err := s.hook("BuildCreateValidate", c); err != nil { |
| 183 | return err |
| 184 | } |
| 185 | |
| 186 | app := c.Var("app") |
| 187 | url := c.Value("url") |
| 188 | |
| 189 | var opts structs.BuildCreateOptions |
| 190 | if err := stdapi.UnmarshalOptions(c.Request(), &opts); err != nil { |
| 191 | return err |
| 192 | } |
| 193 | |
| 194 | v, err := s.provider(c).WithContext(c.Context()).BuildCreate(app, url, opts) |
| 195 | if err != nil { |
| 196 | return err |
| 197 | } |
| 198 | |
| 199 | if vs, ok := interface{}(v).(Sortable); ok { |
| 200 | sort.Slice(v, vs.Less) |
| 201 | } |
| 202 | |
| 203 | return c.RenderJSON(v) |
| 204 | } |
| 205 | |
| 206 | func (s *Server) BuildExport(c *stdapi.Context) error { |
| 207 | if err := s.hook("BuildExportValidate", c); err != nil { |
nothing calls this directly
no test coverage detected