Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(v1.6.0): send review form from client for correction actions instead of register form #7604

Merged
merged 3 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
## Bug fixes

- Custom form field validators from country config will work offline. [#7478](https://github.com/opencrvs/opencrvs-core/issues/7478)
- Registrar had to retry from outbox every time they corrected a record. [#7583](https://github.com/opencrvs/opencrvs-core/issues/7583)

### Breaking changes

Expand Down
6 changes: 4 additions & 2 deletions packages/client/src/declarations/submissionMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ export const submissionMiddleware: Middleware<{}, IStoreState> =
}

const isUpdateAction =
isValidationAction(submissionAction) || isRegisterAction(submissionAction)
isValidationAction(submissionAction) ||
isRegisterAction(submissionAction) ||
isCorrectionAction(submissionAction)

const form = isUpdateAction
? getReviewForm(getState())[event]
Expand All @@ -196,7 +198,7 @@ export const submissionMiddleware: Middleware<{}, IStoreState> =
graphqlPayload.registration.correction.values = changedValues
}

if (isUpdateAction) {
if (isUpdateAction && !isCorrectionAction(submissionAction)) {
const changedValues = getChangedValues(form, declaration, offlineData)
graphqlPayload.registration ??= {}
graphqlPayload.registration.changedValues = changedValues
Expand Down
Loading