Order Review errors reflect only the latest validation
Order Review errors reflect only the latest validation
In Order Review, clicking Order validates the campaign again. The new errors used to be merged into the errors stored before, so a field that had been corrected kept its error, inline and in the error banner, until the whole form was valid. This showed most in layouts that put every section into Order Review.
The error banner also left out some campaign errors. Once the general campaign
fields pass, the validation response is wrapped as { errors, has_errors },
and it can still contain campaign errors such as Target Group or the company
logo next to the posting-requirement errors. The banner listed only the
posting-requirement errors from that response.
What changed
- Order in Order Review:
hapi.orderJourney.state.orderErrorsis replaced with the latest validation response, or set tonullwhen the campaign is valid. A corrected field loses its error on the next click even while other errors remain. - Other steps: each step replaces only its own errors, as before, and now also clears them correctly when the stored and the new response have different shapes.
- Error banner: campaign errors inside a wrapped response are listed like any other error.
SDK state
orderErrors keeps the shape the API returned: bare for campaign errors, or
{ errors, has_errors } once the general campaign fields pass. Code that reads
it should handle both.