perf: apply record optimistic effects with cache.modify on mutation (#3540)
* perf: apply record optimistic effects with cache.modify on mutation Closes #3509 * refactor: return early when created records do not match filter * fix: fix id generation on record creation * fix: comment filtering behavior on record creation * Fixed typing error * refactor: review - use ?? * refactor: review - add variables in readFieldValueToSort * docs: review - add comments for variables.first in triggerUpdateRecordOptimisticEffect * refactor: review - add intermediary variable for 'not' filter in useMultiObjectSearchMatchesSearchFilterAndToSelectQuery * refactor: review - add filter utils * fix: fix tests --------- Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
@ -37,17 +37,10 @@ const data = {
|
||||
id: 'columnId',
|
||||
position: 1,
|
||||
name: 'Column Title',
|
||||
pipeline: { connect: { id: currentPipelineId } },
|
||||
type: 'ongoing',
|
||||
};
|
||||
|
||||
export const variables = {
|
||||
input: {
|
||||
id: mockId,
|
||||
variables: {
|
||||
data,
|
||||
},
|
||||
},
|
||||
input: data,
|
||||
};
|
||||
|
||||
export const deleteVariables = { idToDelete: 'columnId' };
|
||||
|
||||
@ -13,10 +13,9 @@ export const usePipelineSteps = () => {
|
||||
objectNameSingular: CoreObjectNameSingular.PipelineStep,
|
||||
});
|
||||
|
||||
const { deleteOneRecord: deleteOnePipelineStep } =
|
||||
useDeleteOneRecord<PipelineStep>({
|
||||
objectNameSingular: CoreObjectNameSingular.PipelineStep,
|
||||
});
|
||||
const { deleteOneRecord: deleteOnePipelineStep } = useDeleteOneRecord({
|
||||
objectNameSingular: CoreObjectNameSingular.PipelineStep,
|
||||
});
|
||||
|
||||
const handlePipelineStepAdd = useRecoilCallback(
|
||||
({ snapshot }) =>
|
||||
@ -25,16 +24,10 @@ export const usePipelineSteps = () => {
|
||||
if (!currentPipeline?.id) return;
|
||||
|
||||
return createOnePipelineStep?.({
|
||||
variables: {
|
||||
data: {
|
||||
color: boardColumn.colorCode ?? 'gray',
|
||||
id: boardColumn.id,
|
||||
position: boardColumn.position,
|
||||
name: boardColumn.title,
|
||||
pipeline: { connect: { id: currentPipeline.id } },
|
||||
type: 'ongoing',
|
||||
},
|
||||
},
|
||||
color: boardColumn.colorCode ?? 'gray',
|
||||
id: boardColumn.id,
|
||||
position: boardColumn.position,
|
||||
name: boardColumn.title,
|
||||
});
|
||||
},
|
||||
[createOnePipelineStep],
|
||||
|
||||
Reference in New Issue
Block a user