Skip to content

Commit

Permalink
Merge pull request #211 from InseeFr/v2-fixReadOnly
Browse files Browse the repository at this point in the history
fix: fix readOnly on OrchestorManager
  • Loading branch information
ORogel authored Jan 24, 2023
2 parents d9fff8d + e224d75 commit ad37d02
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stromae",
"version": "2.2.13",
"version": "2.2.14",
"description": "Web application for the management of questionnaires powered by Lunatic",
"repository": {
"type": "git",
Expand Down
20 changes: 12 additions & 8 deletions src/components/orchestrator/manager/orchestratorManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,18 @@ const OrchestratorManager = () => {
const [errorSending, setErrorSending] = useState(null);

const sendData = async (dataToSave) => {
const { data, stateData } = dataToSave;
const { /*status,*/ error: dataError } = await putData(data);
const { /*status,*/ error: stateDataError } = await putStateData(stateData);
const paradatas = LOGGER.getEventsToSend();
const { error: paradataPostError } = await postParadata(paradatas);
if (dataError || stateDataError || paradataPostError)
if (paradataPostError) setErrorSending('Error during sending');
LOGGER.clear();
if (!readonly) {
const { data, stateData } = dataToSave;
const { /*status,*/ error: dataError } = await putData(data);
const { /*status,*/ error: stateDataError } = await putStateData(
stateData
);
const paradatas = LOGGER.getEventsToSend();
const { error: paradataPostError } = await postParadata(paradatas);
if (dataError || stateDataError || paradataPostError)
if (paradataPostError) setErrorSending('Error during sending');
LOGGER.clear();
}
};

const logoutAndClose = () => {
Expand Down

0 comments on commit ad37d02

Please sign in to comment.