Skip to content

Commit

Permalink
[Exemption d'alertes] Correction du pavillon envoyé (#2568)
Browse files Browse the repository at this point in the history
## Linked issues

- Resolve #1370 
- Resolve #2556

----

- [ ] Tests E2E (Cypress)
  • Loading branch information
louptheron committed Oct 3, 2023
2 parents 491636d + 9f0e48f commit 4781a60
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ export const createOrUpdateRegulation = (processingRegulation, id, previousId) =
* /!\ This constraint is only applied to the local (CROSS) regulations table.
*/
await dispatch(resetPreviousRegulation(previousId, id))

/**
* We must wait for the reset to be done.
* TODO Add the two UPDATE into the same transaction to remove this `setTimeout`
*/
setTimeout(() => {
/**
* Then, we update the new regulation with the values of the previous one
*/
dispatch(updateRegulation(feature, REGULATION_ACTION_TYPE.UPDATE))
}, 1000)

return
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export function VesselField() {
setValues({
...values,
externalReferenceNumber: nextVessel.externalReferenceNumber || null,
flagState: nextVessel.flagState,
flagState: nextVessel.flagState?.toUpperCase(),
internalReferenceNumber: nextVessel.internalReferenceNumber || null,
ircs: nextVessel.ircs || null,
vesselId: nextVessel.vesselId || null,
Expand Down

0 comments on commit 4781a60

Please sign in to comment.