From 96fb709505bfbede06661cd1fed823c3222fcb99 Mon Sep 17 00:00:00 2001 From: Amiram_se Date: Thu, 5 Nov 2026 19:01:42 +0400 Subject: [PATCH] fix(onboarding): require and send the consent at registration step 5 The API refuses the first profile completion without termsAccepted, and the web app never sent it, so no analyst could finish registering. The box now always shows, with or without a link, and completing sends the consent. Co-Authored-By: Claude Opus 5.5 --- .../components/ProfileForm.tsx | 59 +++++++++---------- .../complete-creator-profile/actions.test.ts | 26 ++++++++ .../complete-creator-profile/actions.ts | 4 +- .../use-creator-profile-page.ts | 4 +- .../profile/repositories/profile/profile.ts | 9 ++- .../profile/repositories/profile/types.ts | 3 + .../validations/profile-validations.test.ts | 25 ++++++++ .../shared/validations/profile-validations.ts | 37 +++++------- 8 files changed, 108 insertions(+), 59 deletions(-) create mode 100644 platforms/market/src/features/profile/actions/complete-creator-profile/actions.test.ts create mode 100644 platforms/market/src/shared/validations/profile-validations.test.ts diff --git a/platforms/market/src/app/screens/(onboarding)/onboarding/creator-profile/organisms/creator-profile-step/components/ProfileForm.tsx b/platforms/market/src/app/screens/(onboarding)/onboarding/creator-profile/organisms/creator-profile-step/components/ProfileForm.tsx index 38ed207..17918ce 100644 --- a/platforms/market/src/app/screens/(onboarding)/onboarding/creator-profile/organisms/creator-profile-step/components/ProfileForm.tsx +++ b/platforms/market/src/app/screens/(onboarding)/onboarding/creator-profile/organisms/creator-profile-step/components/ProfileForm.tsx @@ -37,9 +37,8 @@ import { SaveStatus } from './SaveStatus'; import { StepLayout } from './StepLayout'; /** - * Step 5's form for a creator, top to bottom: photo, bio, markets, links and, once there is a - * link, the consent; «تکمیل ثبت‌نام» under it with the autosave line. Leaving a field saves at - * once. The preview opens in a sheet on mobile and stays beside the form on desktop. + * Step 5's form for a creator, top to bottom: photo, bio, markets, links and the consent; + * «تکمیل ثبت‌نام» under it with the autosave line. Leaving a field saves at once. The preview opens in a sheet on mobile and stays beside the form on desktop. */ export function ProfileForm({ page, @@ -210,34 +209,32 @@ export function ProfileForm({ layout={layout} optional /> - {links.rows.length > 0 && ( - ( - - field.onChange(event.target.checked)} - onBlur={field.onBlur} - invalid={fieldState.error != null} - aria-describedby={ - fieldState.error ? consentErrorId : undefined - } - > - {t('register.profile.links.consent')} - - {fieldState.error && ( - - {translateMessage(t, fieldState.error.message)} - - )} - - )} - /> - )} + ( + + field.onChange(event.target.checked)} + onBlur={field.onBlur} + invalid={fieldState.error != null} + aria-describedby={ + fieldState.error ? consentErrorId : undefined + } + > + {t('register.profile.links.consent')} + + {fieldState.error && ( + + {translateMessage(t, fieldState.error.message)} + + )} + + )} + />