From 6bd44e78a0b6e90469eb41e97c4c43ce7e7a766e Mon Sep 17 00:00:00 2001 From: AmirReza Jamali Date: Tue, 11 Nov 2025 13:00:50 +0330 Subject: [PATCH] refactor(marketing): Update form field names to use snake_case for consistency --- src/app/marketing/_components/ChartStep.tsx | 8 +++---- .../marketing/_components/ContactsStep.tsx | 4 ++-- src/app/marketing/_components/HeroStep.tsx | 24 +++++++++---------- .../_components/useChartStepPresenter.ts | 2 +- .../_components/useContactsStepPresenter.ts | 2 +- .../_components/useHeroStepPresenter.ts | 6 ++--- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/app/marketing/_components/ChartStep.tsx b/src/app/marketing/_components/ChartStep.tsx index 053f0f2..84a6e3d 100644 --- a/src/app/marketing/_components/ChartStep.tsx +++ b/src/app/marketing/_components/ChartStep.tsx @@ -59,18 +59,18 @@ const ChartStep = forwardRef(

)} - {errors.missedAmount && ( + {errors.missed_amount && (

- {errors.missedAmount.message} + {errors.missed_amount.message}

)} diff --git a/src/app/marketing/_components/ContactsStep.tsx b/src/app/marketing/_components/ContactsStep.tsx index 5f1a5d8..afe3d4c 100644 --- a/src/app/marketing/_components/ContactsStep.tsx +++ b/src/app/marketing/_components/ContactsStep.tsx @@ -52,9 +52,9 @@ const ContactsStep = forwardRef( placeholder="Enter Description" /> diff --git a/src/app/marketing/_components/HeroStep.tsx b/src/app/marketing/_components/HeroStep.tsx index 2e7cf2a..5468456 100644 --- a/src/app/marketing/_components/HeroStep.tsx +++ b/src/app/marketing/_components/HeroStep.tsx @@ -71,7 +71,7 @@ const HeroStep = forwardRef(({ initialData }, ref) => {

)} (({ initialData }, ref) => { }, })} label="Button Text" - name="buttonText" + name="button_text" required type="text" placeholder="Enter Button Text" /> - {errors.buttonText && ( + {errors.button_text && (

- {errors.buttonText.message} + {errors.button_text.message}

)} (({ initialData }, ref) => { }, })} label="Button Link" - name="buttonLink" + name="button_link" required type="url" placeholder="Enter Button Link" /> - {errors.buttonLink && ( + {errors.button_link && (

- {errors.buttonLink.message} + {errors.button_link.message}

)} (({ initialData }, ref) => { }, })} label="GIF File URL" - name="gifFile" + name="gif_file" required type="text" placeholder="Enter GIF File URL" /> - {errors.gifFile && ( + {errors.gif_file && (

- {errors.gifFile.message} + {errors.gif_file.message}

)} diff --git a/src/app/marketing/_components/useChartStepPresenter.ts b/src/app/marketing/_components/useChartStepPresenter.ts index 54bb60d..0d77a65 100644 --- a/src/app/marketing/_components/useChartStepPresenter.ts +++ b/src/app/marketing/_components/useChartStepPresenter.ts @@ -3,7 +3,7 @@ import { useFieldArray, useForm } from "react-hook-form"; export interface IChartStepFields { title: string; - missedAmount: string; + missed_amount: string; data: { key: string; value: number }[]; } diff --git a/src/app/marketing/_components/useContactsStepPresenter.ts b/src/app/marketing/_components/useContactsStepPresenter.ts index 72caaf4..58188de 100644 --- a/src/app/marketing/_components/useContactsStepPresenter.ts +++ b/src/app/marketing/_components/useContactsStepPresenter.ts @@ -4,7 +4,7 @@ import { useFieldArray, useForm } from "react-hook-form"; export interface IContactsStepFields { title: string; description: string; - submitButtonText: string; + submit_button_text: string; fields: { name: string; label: string; diff --git a/src/app/marketing/_components/useHeroStepPresenter.ts b/src/app/marketing/_components/useHeroStepPresenter.ts index a7b826d..6cb5bbf 100644 --- a/src/app/marketing/_components/useHeroStepPresenter.ts +++ b/src/app/marketing/_components/useHeroStepPresenter.ts @@ -4,9 +4,9 @@ import { useForm } from "react-hook-form"; export interface IHeroStepFields { title: string; description: string; - buttonText: string; - buttonLink: string; - gifFile: string; + button_text: string; + button_link: string; + gif_file: string; } const useHeroStepPresenter = (initialData?: IHeroStepFields) => {