Relations many in table view (#5842)
Closes #5924. Adding the "many" side of relations in the table view, and fixing some issues (glitch in Multi record select, cache update after update). --------- Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
@ -1,15 +1,15 @@
|
||||
import { useEffect } from 'react';
|
||||
import { Decorator } from '@storybook/react';
|
||||
|
||||
import { useSetRecordInStore } from '@/object-record/record-store/hooks/useSetRecordInStore';
|
||||
import { useUpsertRecordsInStore } from '@/object-record/record-store/hooks/useUpsertRecordsInStore';
|
||||
|
||||
export const RecordStoreDecorator: Decorator = (Story, context) => {
|
||||
const { records } = context.parameters;
|
||||
|
||||
const { setRecords } = useSetRecordInStore();
|
||||
const { upsertRecords } = useUpsertRecordsInStore();
|
||||
|
||||
useEffect(() => {
|
||||
setRecords(records);
|
||||
upsertRecords(records);
|
||||
});
|
||||
|
||||
return <Story />;
|
||||
|
||||
Reference in New Issue
Block a user