mortezaei 1 week ago
parent
commit
602ff4a59c
  1. 15
      src/components/Componentes/question-answer-storage.tsx

15
src/components/Componentes/question-answer-storage.tsx

@ -478,12 +478,19 @@ export function QuestionAnswersProvider({
return; return;
} }
const fullPayload = createPayload(answersRef.current, questionsRef.current, backendFieldsRef.current);
const nextDirtyKey = fullPayload.fields.find((field) => dirtyKeysRef.current.has(field.key))?.key;
const fullPayload = createPayload(
answersRef.current,
questionsRef.current,
backendFieldsRef.current,
);
const nextDirtyKey = fullPayload.fields.find((field) =>
dirtyKeysRef.current.has(field.key),
)?.key;
const payload = { const payload = {
...fullPayload, ...fullPayload,
fields: nextDirtyKey ? fullPayload.fields.filter((field) => field.key === nextDirtyKey) : [],
version: schemaVersionRef.current,
fields: nextDirtyKey
? fullPayload.fields.filter((field) => field.key === nextDirtyKey)
: [],
}; };
const revision = answersRevisionRef.current; const revision = answersRevisionRef.current;

Loading…
Cancel
Save