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

@ -51,7 +51,8 @@ export function parseQuizData(quizDataResponse: GetQuizDataResponse): Omit<QuizS
answerType: "single",
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 {
description: item.desc,
id: item.id,