@ -3,11 +3,11 @@ import type { ComputedRef, Ref } from 'vue'
import { message } from 'ant-design-vue'
import { message } from 'ant-design-vue'
import {
import {
IsPublicInj ,
IsPublicInj ,
ReloadViewDataHookInj ,
computed ,
computed ,
extractSdkResponseErrorMsg ,
extractSdkResponseErrorMsg ,
inject ,
inject ,
ref ,
ref ,
useDebounceFn ,
useMetas ,
useMetas ,
useNuxtApp ,
useNuxtApp ,
useUIPermission ,
useUIPermission ,
@ -23,8 +23,6 @@ export function useViewFilters(
currentFilters? : Filter [ ] ,
currentFilters? : Filter [ ] ,
isNestedRoot? : boolean ,
isNestedRoot? : boolean ,
) {
) {
const reloadHook = inject ( ReloadViewDataHookInj )
const { nestedFilters } = useSmartsheetStoreOrThrow ( )
const { nestedFilters } = useSmartsheetStoreOrThrow ( )
const isPublic = inject ( IsPublicInj , ref ( false ) )
const isPublic = inject ( IsPublicInj , ref ( false ) )
@ -173,8 +171,6 @@ export function useViewFilters(
fk_parent_id : parentId ,
fk_parent_id : parentId ,
} )
} )
}
}
reloadHook ? . trigger ( )
} catch ( e : any ) {
} catch ( e : any ) {
console . log ( e )
console . log ( e )
message . error ( await extractSdkResponseErrorMsg ( e ) )
message . error ( await extractSdkResponseErrorMsg ( e ) )
@ -183,6 +179,8 @@ export function useViewFilters(
reloadData ? . ( )
reloadData ? . ( )
}
}
const saveOrUpdateDebounced = useDebounceFn ( saveOrUpdate , 500 )
const addFilter = ( ) = > {
const addFilter = ( ) = > {
filters . value . push ( { . . . placeholderFilter } )
filters . value . push ( { . . . placeholderFilter } )
$e ( 'a:filter:add' , { length : filters.value.length } )
$e ( 'a:filter:add' , { length : filters.value.length } )
@ -221,5 +219,5 @@ export function useViewFilters(
} ,
} ,
)
)
return { filters , loadFilters , sync , deleteFilter , saveOrUpdate , addFilter , addFilterGroup }
return { filters , loadFilters , sync , deleteFilter , saveOrUpdate , addFilter , addFilterGroup , saveOrUpdateDebounced }
}
}