fix inntr quiz id param

This commit is contained in:
Nastya 2025-08-09 23:57:33 +03:00
parent 3baaef83fe
commit b1c3ab7314
2 changed files with 19 additions and 2 deletions

@ -17,6 +17,8 @@ type InputProps = {
isPhone?: boolean; isPhone?: boolean;
type?: HTMLInputTypeAttribute; type?: HTMLInputTypeAttribute;
value?: string; value?: string;
onBlur?: () => void;
error?: string;
}; };
const TextField = MuiTextField as unknown as FC<TextFieldProps>; const TextField = MuiTextField as unknown as FC<TextFieldProps>;
@ -34,7 +36,18 @@ function phoneChange(e: ChangeEvent<HTMLInputElement>, mask: string) {
return a || ""; return a || "";
} }
export const CustomInput = ({ title, desc, Icon, onChange, onChangePhone, isPhone, type, value }: InputProps) => { export const CustomInput = ({
title,
desc,
Icon,
onChange,
onChangePhone,
isPhone,
type,
value,
onBlur,
error,
}: InputProps) => {
const theme = useTheme(); const theme = useTheme();
const isMobile = useRootContainerSize() < 600; const isMobile = useRootContainerSize() < 600;
const { settings } = useQuizStore(); const { settings } = useQuizStore();
@ -57,8 +70,11 @@ export const CustomInput = ({ title, desc, Icon, onChange, onChangePhone, isPhon
onChange={(e: ChangeEvent<HTMLInputElement>) => onChange={(e: ChangeEvent<HTMLInputElement>) =>
isPhone ? onChangePhone?.(phoneChange(e, mask)) : onChange?.(e) isPhone ? onChangePhone?.(phoneChange(e, mask)) : onChange?.(e)
} }
onBlur={onBlur}
type={isPhone ? "tel" : type} type={isPhone ? "tel" : type}
value={value} value={value}
error={!!error}
helperText={error}
sx={{ sx={{
width: isMobile ? "100%" : "390px", width: isMobile ? "100%" : "390px",
backgroundColor: theme.palette.background.default, backgroundColor: theme.palette.background.default,

@ -51,7 +51,8 @@ export function parseQuizData(quizDataResponse: GetQuizDataResponse): Omit<QuizS
answerType: "single", answerType: "single",
onlyNumbers: false, onlyNumbers: false,
}; };
if (item.c) content.id = Math.floor(Math.random() * 9999999999) + 1; // Убираю замену ID - оставляю оригинальный с бэкенда
// if (item.c) content.id = Math.floor(Math.random() * 9999999999) + 1;
return { return {
description: item.desc, description: item.desc,
id: item.id, id: item.id,