File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -1203,7 +1203,19 @@ module.exports = (router) => {
12031203 rightBreastProcedures . includes ( 'Breast implants' ) ||
12041204 leftBreastProcedures . includes ( 'Breast implants' )
12051205
1206- if ( hasBreastImplants ) {
1206+ // Check if implants have been removed
1207+ const implantsRemoved =
1208+ Array . isArray ( medicalHistoryTemp ?. implantsRemoved ) &&
1209+ medicalHistoryTemp . implantsRemoved . includes ( 'Implants have been removed' )
1210+
1211+ // Check if consent was already given (editing existing item)
1212+ const alreadyConsented = medicalHistoryTemp ?. consentGiven
1213+
1214+ // Only show consent page if:
1215+ // - Breast implants are selected
1216+ // - AND implants have NOT been removed
1217+ // - AND consent has NOT already been given
1218+ if ( hasBreastImplants && ! implantsRemoved && ! alreadyConsented ) {
12071219 // Redirect to consent page immediately - we'll save the data after consent
12081220 return res . redirect (
12091221 urlWithReferrer (
You can’t perform that action at this time.
0 commit comments