Fix: Table / Board createView bug (#1782)
* fix createView for tables and board page * removed residual console.log from InlineCell component
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
import { useSearchParams } from 'react-router-dom';
|
||||
|
||||
import { RecoilScopeContext } from '@/types/RecoilScopeContext';
|
||||
import { useBoardColumns } from '@/ui/board/hooks/useBoardColumns';
|
||||
import { boardCardFieldsScopedState } from '@/ui/board/states/boardCardFieldsScopedState';
|
||||
@ -29,10 +31,13 @@ export const useBoardViews = ({
|
||||
const filters = useRecoilScopedValue(filtersScopedState, RecoilScopeContext);
|
||||
const sorts = useRecoilScopedValue(sortsScopedState, RecoilScopeContext);
|
||||
|
||||
const [_, setSearchParams] = useSearchParams();
|
||||
|
||||
const handleViewCreate = async (viewId: string) => {
|
||||
await createViewFields(boardCardFields, viewId);
|
||||
await createViewFilters(filters, viewId);
|
||||
await createViewSorts(sorts, viewId);
|
||||
setSearchParams({ view: viewId });
|
||||
};
|
||||
|
||||
const { createView, deleteView, isFetchingViews, updateView } = useViews({
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
import { useSearchParams } from 'react-router-dom';
|
||||
|
||||
import { FieldMetadata } from '@/ui/field/types/FieldMetadata';
|
||||
import { TableRecoilScopeContext } from '@/ui/table/states/recoil-scope-contexts/TableRecoilScopeContext';
|
||||
import { tableColumnsScopedState } from '@/ui/table/states/tableColumnsScopedState';
|
||||
@ -29,10 +31,13 @@ export const useTableViews = ({
|
||||
);
|
||||
const sorts = useRecoilScopedValue(sortsScopedState, TableRecoilScopeContext);
|
||||
|
||||
const [_, setSearchParams] = useSearchParams();
|
||||
|
||||
const handleViewCreate = async (viewId: string) => {
|
||||
await createViewFields(tableColumns, viewId);
|
||||
await createViewFilters(filters, viewId);
|
||||
await createViewSorts(sorts, viewId);
|
||||
setSearchParams({ view: viewId });
|
||||
};
|
||||
|
||||
const { createView, deleteView, isFetchingViews, updateView } = useViews({
|
||||
|
||||
Reference in New Issue
Block a user