| 221 | } |
| 222 | |
| 223 | func (s *Server) BuildGet(c *stdapi.Context) error { |
| 224 | if err := s.hook("BuildGetValidate", c); err != nil { |
| 225 | return err |
| 226 | } |
| 227 | |
| 228 | app := c.Var("app") |
| 229 | id := c.Var("id") |
| 230 | |
| 231 | v, err := s.provider(c).WithContext(c.Context()).BuildGet(app, id) |
| 232 | if err != nil { |
| 233 | return err |
| 234 | } |
| 235 | |
| 236 | if vs, ok := interface{}(v).(Sortable); ok { |
| 237 | sort.Slice(v, vs.Less) |
| 238 | } |
| 239 | |
| 240 | return c.RenderJSON(v) |
| 241 | } |
| 242 | |
| 243 | func (s *Server) BuildImport(c *stdapi.Context) error { |
| 244 | if err := s.hook("BuildImportValidate", c); err != nil { |