feat(09-04): compile ordered Winter list schemas
- Typed columns, actions, default sort, search term, and page sizes - Omitted sortable defaults to true and empty collections marshal as arrays - Unknown keys, bad defaults, and path escape fail before routes are served
This commit is contained in:
@@ -136,16 +136,11 @@ func constrainController(g pact.Router) {
|
||||
|
||||
func (s *service) listSchema(w http.ResponseWriter, r *http.Request) {
|
||||
s.protect(w, r, func(cc *CompiledController) {
|
||||
cols := cc.List.Columns
|
||||
if cols == nil {
|
||||
cols = []ListColumn{}
|
||||
schema := cc.List
|
||||
if schema == nil {
|
||||
schema = &ListSchema{}
|
||||
}
|
||||
WriteData(w, http.StatusOK, &ListSchema{
|
||||
Title: cc.List.Title,
|
||||
RecordsPerPage: cc.List.RecordsPerPage,
|
||||
ShowSearch: cc.List.ShowSearch,
|
||||
Columns: cols,
|
||||
}, map[string]any{})
|
||||
WriteData(w, http.StatusOK, schema, map[string]any{})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user