@@ -163,7 +163,8 @@ const getTableSchema = (schema: any, isMultiple: boolean) => {
163
163
}
164
164
] ,
165
165
unwind : schema . options . unwind || { } ,
166
- default_sort : schema . options . default_sort || { }
166
+ default_sort : schema . options . default_sort || { } ,
167
+ default_filter : schema . options . default_filter || [ ]
167
168
}
168
169
} ;
169
170
@@ -319,13 +320,15 @@ const getSchema = async ({ schema, resource_type, options = {} }: GetSchemaParam
319
320
320
321
} else if ( schema === 'table' ) {
321
322
const defaultSort = getMetadataSchema ( metadata , 'view.table.layout.options.default_sort' , false ) ;
323
+ const defaultFilter = getMetadataSchema ( metadata , 'view.table.layout.options.default_filter' , false ) ;
322
324
const tableFields = getMetadataSchema ( metadata , 'view.table.layout.options.fields' , false ) ;
323
325
324
326
const defaultSchema = loadDefaultSchema ( schema , includeWorkspaceInfo ) ;
325
327
const schemaJSON = ejs . render ( defaultSchema , { fields : tableFields } ) ;
326
328
const schemaData = JSON . parse ( schemaJSON ) ;
327
329
328
330
schemaData [ 'options' ] [ 'default_sort' ] = defaultSort ;
331
+ schemaData [ 'options' ] [ 'default_filter' ] = defaultFilter ;
329
332
330
333
if ( ! options ?. include_optional_fields ) {
331
334
const customSchemaData = await getCustomSchema ( schema , resource_type , options ) ;
0 commit comments