mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
Fix filters and sort not added to query in table editor (#34862)
fix filters and sort not added to query in table editor
This commit is contained in:
1 parent
252cfcc488
commit
a5b626b7bc
2 files changed
+5
-5
No files matched your search
@@ -24,6 +24,7 @@ import { Grid } from './components/grid/Grid'
|
||||
import Header, { HeaderProps } from './components/header/Header'
|
||||
import { RowContextMenu } from './components/menu'
|
||||
import { Filter, GridProps } from './types'
|
||||
import { useTableEditorFiltersSort } from 'hooks/misc/useTableEditorFiltersSort'
|
||||
|
||||
export const SupabaseGrid = ({
|
||||
customHeader,
|
||||
@@ -44,9 +45,8 @@ export const SupabaseGrid = ({
|
||||
const gridRef = useRef<DataGridHandle>(null)
|
||||
const [mounted, setMounted] = useState(false)
|
||||
|
||||
const [{ sort, filter }, setParams] = useUrlState({
|
||||
arrayKeys: ['sort', 'filter'],
|
||||
})
|
||||
const { filters: filter, sorts: sort, setParams } = useTableEditorFiltersSort()
|
||||
|
||||
const sorts = formatSortURLParams(snap.table.name, sort as string[] | undefined)
|
||||
const filters = formatFilterURLParams(filter as string[])
|
||||
|
||||
|
||||
@@ -161,8 +161,8 @@ const DefaultHeader = () => {
|
||||
return (
|
||||
<div className="flex items-center gap-4">
|
||||
<div className="flex items-center gap-2">
|
||||
<FilterPopover filters={filters as string[]} onApplyFilters={onApplyFilters} />
|
||||
<SortPopover sorts={sorts as string[]} onApplySorts={onApplySorts} />
|
||||
<FilterPopover filters={filters} onApplyFilters={onApplyFilters} />
|
||||
<SortPopover sorts={sorts} onApplySorts={onApplySorts} />
|
||||
</div>
|
||||
{canAddNew && (
|
||||
<>
|
||||
|
||||
Reference in new issue
Block a user