diff --git a/src/models/Signup.ts b/src/models/Signup.ts index 0997385..0bd738d 100644 --- a/src/models/Signup.ts +++ b/src/models/Signup.ts @@ -2,7 +2,7 @@ import { OptionTypes } from "@components/Widgets/SignupQuestionsWidget/common"; export interface Signup { id?: number; // Database id for completed signup - submitKey?: string; // Signup request idempotency key + submit_id?: string; // Signup request idempotency key signupForm_id: number; answer: string; } diff --git a/src/pages/signup/[id].tsx b/src/pages/signup/[id].tsx index a2d7301..855aff5 100644 --- a/src/pages/signup/[id].tsx +++ b/src/pages/signup/[id].tsx @@ -24,7 +24,7 @@ const FORM_URL = `${process.env.NEXT_PUBLIC_API_URL}/signupForm/`; const SignUpPage: NextPage = ({ initialForm }) => { const router = useRouter(); const id = String(initialForm?.id ?? ""); - const submitKey = uuid(); // Submission key, generated on page refresh + const SUBMIT_ID = uuid(); // Submission key, generated on page refresh const URL = `${FORM_URL}${id}/`; const { data: signupForm, error } = useSWR(URL, (url) => axios.get(url).then((res) => res.data), { fallbackData: initialForm }); @@ -45,7 +45,7 @@ const SignUpPage: NextPage = ({ initialForm }) => { const onSubmit = async ({ formData }: ISubmitEvent) => { const payload: Signup = { - submitKey, // This is for preventing duplicate requests; NOT RELATED TO THE SIGNUP ID IN DATABASE + submit_id: SUBMIT_ID, // This is for preventing duplicate requests; NOT RELATED TO THE SIGNUP ID IN DATABASE signupForm_id: signupForm.id, answer: formData, };