cht-core icon indicating copy to clipboard operation
cht-core copied to clipboard

fix(#8985): remove extra validation for parent place contact

Open freddieptf opened this issue 10 months ago • 5 comments

Fixes #8985

freddieptf avatar Apr 19 '24 16:04 freddieptf

@freddieptf it looks like sonar is complaining about code complexity here. would you mind the little refactor needed to keep sonar satisfied? Thanks!

dianabarsan avatar Apr 22 '24 08:04 dianabarsan

@dianabarsan tests fixed

freddieptf avatar Apr 25 '24 16:04 freddieptf

Hi @freddieptf

It looks like there is an e2e test failure that is genuine: https://github.com/medic/cht-core/actions/runs/8919300697/job/24629918331?pr=9027#step:16:1512

dianabarsan avatar May 06 '24 13:05 dianabarsan

@dianabarsan thanks for pointing that out. I'm going to update the test to align with the new behavior. I think we shouldn't reassign the contact's parent to the place we just created, this way the only side effect is assigning the existing contact as the primary contact for the new place. What you think?

freddieptf avatar May 06 '24 18:05 freddieptf

Indeed @freddieptf . We should not have a contact assignment side-effect as part of setting that contact as primary for another place.

dianabarsan avatar May 06 '24 21:05 dianabarsan