@ -26,7 +26,7 @@ type PartialObjectRecordWithId = Partial<ObjectRecord> & {
|
||||
type useCreateManyRecordsProps = {
|
||||
objectNameSingular: string;
|
||||
recordGqlFields?: RecordGqlOperationGqlRecordFields;
|
||||
skipPostOptmisticEffect?: boolean;
|
||||
skipPostOptimisticEffect?: boolean;
|
||||
shouldMatchRootQueryFilter?: boolean;
|
||||
};
|
||||
|
||||
@ -35,7 +35,7 @@ export const useCreateManyRecords = <
|
||||
>({
|
||||
objectNameSingular,
|
||||
recordGqlFields,
|
||||
skipPostOptmisticEffect = false,
|
||||
skipPostOptimisticEffect = false,
|
||||
shouldMatchRootQueryFilter,
|
||||
}: useCreateManyRecordsProps) => {
|
||||
const apolloClient = useApolloClient();
|
||||
@ -135,7 +135,7 @@ export const useCreateManyRecords = <
|
||||
update: (cache, { data }) => {
|
||||
const records = data?.[mutationResponseField];
|
||||
|
||||
if (!isDefined(records?.length) || skipPostOptmisticEffect) return;
|
||||
if (!isDefined(records?.length) || skipPostOptimisticEffect) return;
|
||||
|
||||
triggerCreateRecordsOptimisticEffect({
|
||||
cache,
|
||||
|
||||
@ -23,7 +23,7 @@ import { isDefined } from 'twenty-shared';
|
||||
type useCreateOneRecordProps = {
|
||||
objectNameSingular: string;
|
||||
recordGqlFields?: RecordGqlOperationGqlRecordFields;
|
||||
skipPostOptmisticEffect?: boolean;
|
||||
skipPostOptimisticEffect?: boolean;
|
||||
shouldMatchRootQueryFilter?: boolean;
|
||||
};
|
||||
|
||||
@ -32,7 +32,7 @@ export const useCreateOneRecord = <
|
||||
>({
|
||||
objectNameSingular,
|
||||
recordGqlFields,
|
||||
skipPostOptmisticEffect = false,
|
||||
skipPostOptimisticEffect = false,
|
||||
shouldMatchRootQueryFilter,
|
||||
}: useCreateOneRecordProps) => {
|
||||
const apolloClient = useApolloClient();
|
||||
@ -95,7 +95,7 @@ export const useCreateOneRecord = <
|
||||
computeReferences: false,
|
||||
});
|
||||
|
||||
if (optimisticRecordNode !== null) {
|
||||
if (skipPostOptimisticEffect === false && optimisticRecordNode !== null) {
|
||||
triggerCreateRecordsOptimisticEffect({
|
||||
cache: apolloClient.cache,
|
||||
objectMetadataItem,
|
||||
@ -117,7 +117,7 @@ export const useCreateOneRecord = <
|
||||
},
|
||||
update: (cache, { data }) => {
|
||||
const record = data?.[mutationResponseField];
|
||||
if (skipPostOptmisticEffect === false && isDefined(record)) {
|
||||
if (skipPostOptimisticEffect === false && isDefined(record)) {
|
||||
triggerCreateRecordsOptimisticEffect({
|
||||
cache,
|
||||
objectMetadataItem,
|
||||
|
||||
@ -139,7 +139,7 @@ export const FormNumberFieldInput = ({
|
||||
</FormFieldInputRowContainer>
|
||||
|
||||
{hint ? <InputHint>{hint}</InputHint> : null}
|
||||
{error && <InputErrorHelper>{error}</InputErrorHelper>}
|
||||
<InputErrorHelper>{error}</InputErrorHelper>
|
||||
</FormFieldInputContainer>
|
||||
);
|
||||
};
|
||||
|
||||
@ -91,7 +91,7 @@ export const FormTextFieldInput = ({
|
||||
) : null}
|
||||
</FormFieldInputRowContainer>
|
||||
{hint && <InputHint>{hint}</InputHint>}
|
||||
{error && <InputErrorHelper>{error}</InputErrorHelper>}
|
||||
<InputErrorHelper>{error}</InputErrorHelper>
|
||||
</FormFieldInputContainer>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user