исправлен вывод ошибки при неправильном пароле

This commit is contained in:
Tamara 2024-01-28 23:45:13 +03:00
parent b63fb76af2
commit d2dbedc0be
8 changed files with 70 additions and 46 deletions

@ -21,7 +21,7 @@ interface Props {
placeholderHelp: string;
placeholderField: string;
closeDrawer: () => void;
noinputs: boolean
noinputs: boolean;
}
export default function NewFieldParent({
@ -31,7 +31,7 @@ export default function NewFieldParent({
placeholderField,
outerContainerSx: sx,
children,
noinputs = false
noinputs = false,
}: Props) {
const quiz = useCurrentQuiz();
@ -46,37 +46,39 @@ export default function NewFieldParent({
gap: "20px",
}}
>
{!noinputs &&
<>
<Box sx={{ display: "flex", flexDirection: "column", gap: "15px" }}>
<Typography>Название поля</Typography>
<CustomTextField
onChange={({ target }) => {
updateQuiz(quiz.id, (quiz) => {
quiz.config.formContact.fields[defaultValue].text = target.value;
});
}}
value={quiz.config.formContact.fields[defaultValue].text}
placeholder={placeholderHelp}
text={""}
/>
</Box>
<Box sx={{ display: "flex", flexDirection: "column", gap: "15px" }}>
<Typography>Подсказка внутри поля</Typography>
<CustomTextField
onChange={({ target }) => {
updateQuiz(quiz.id, (quiz) => {
quiz.config.formContact.fields[defaultValue].innerText =
target.value;
});
}}
value={quiz.config.formContact.fields[defaultValue].innerText}
placeholder={placeholderField}
text={""}
/>
</Box>
</>}
{!noinputs && (
<>
<Box sx={{ display: "flex", flexDirection: "column", gap: "15px" }}>
<Typography>Название поля</Typography>
<CustomTextField
onChange={({ target }) => {
updateQuiz(quiz.id, (quiz) => {
quiz.config.formContact.fields[defaultValue].text =
target.value;
});
}}
value={quiz.config.formContact.fields[defaultValue].text}
placeholder={placeholderHelp}
text={""}
/>
</Box>
<Box sx={{ display: "flex", flexDirection: "column", gap: "15px" }}>
<Typography>Подсказка внутри поля</Typography>
<CustomTextField
onChange={({ target }) => {
updateQuiz(quiz.id, (quiz) => {
quiz.config.formContact.fields[defaultValue].innerText =
target.value;
});
}}
value={quiz.config.formContact.fields[defaultValue].innerText}
placeholder={placeholderField}
text={""}
/>
</Box>
</>
)}
{/*<Box sx={{ display: "flex", flexDirection: "column", gap: "15px" }}>*/}
{/* <Typography>Ключ</Typography>*/}
{/* <TextField*/}

@ -109,7 +109,9 @@ export default function Counter() {
>
760
</Typography>
<Typography>готовых шаблонов для разных ниш <br></br> (в разработке)</Typography>
<Typography>
готовых шаблонов для разных ниш <br></br> (в разработке)
</Typography>
</Box>
</Box>
</Box>

@ -121,7 +121,12 @@ export default function Component() {
>
<Button
variant="text"
sx={{ fontSize: "16px", fontWeight: 500, color: "white", justifyContent: "start" }}
sx={{
fontSize: "16px",
fontWeight: 500,
color: "white",
justifyContent: "start",
}}
href={"https://hub.pena.digital/docs/oferta"}
target="_blank"
>
@ -129,7 +134,12 @@ export default function Component() {
</Button>
<Button
variant="text"
sx={{ fontSize: "16px", fontWeight: 500, color: "white", justifyContent: "start" }}
sx={{
fontSize: "16px",
fontWeight: 500,
color: "white",
justifyContent: "start",
}}
href={"https://hub.pena.digital/docs/privacy"}
target="_blank"
>

@ -168,7 +168,10 @@ export default function HowItWorks() {
}}
>
<Icon21 />
<Typography fontSize="18px"> на сайте (в разработке)</Typography>
<Typography fontSize="18px">
{" "}
на сайте (в разработке)
</Typography>
</Box>
<Box
sx={{
@ -210,7 +213,9 @@ export default function HowItWorks() {
}}
>
<Icon1 />
<Typography fontSize="18px">А/Б тестирование (в разработке)</Typography>
<Typography fontSize="18px">
А/Б тестирование (в разработке)
</Typography>
</Box>
</Box>
</Box>
@ -458,7 +463,10 @@ export default function HowItWorks() {
}}
>
<Icon15 />
<Typography fontSize="18px"> калькулятор цен<br></br>(в разработке)</Typography>
<Typography fontSize="18px">
{" "}
калькулятор цен<br></br>(в разработке)
</Typography>
</Box>
</Box>
<Box
@ -610,7 +618,10 @@ export default function HowItWorks() {
}}
>
<Icon19 />
<Typography fontSize="18px"> интеграция с CRM<br></br>(в разработке)</Typography>
<Typography fontSize="18px">
{" "}
интеграция с CRM<br></br>(в разработке)
</Typography>
</Box>
</Box>
<Box

@ -38,7 +38,7 @@ const StepperText: Record<string, string> = {
function TariffPage() {
const theme = useTheme();
const token = useToken()
const token = useToken();
const isTablet = useMediaQuery(theme.breakpoints.down(1000));
const userId = useUserStore((state) => state.userId);
const location = useLocation();

@ -111,7 +111,6 @@ export const Footer = ({
}, [question, answers]);
const showResult = (nextQuestion: QuizQuestionResult) => {
const isEmpty = checkEmptyData({ resultData: nextQuestion });
if (nextQuestion) {
if (nextQuestion && quiz?.config.resultInfo.showResultForm === "before") {

@ -30,7 +30,6 @@ export const StartPageViewPublication = ({ setVisualStartPage }: Props) => {
if (!quiz) return null;
const handleCopyNumber = () => {
navigator.clipboard.writeText(quiz.config.info.phonenumber);
};
@ -84,7 +83,6 @@ export const StartPageViewPublication = ({ setVisualStartPage }: Props) => {
) : null
) : null;
return (
<Paper
className="quiz-preview-draghandle"

@ -16,7 +16,6 @@ const translateMessage: Record<string, string> = {
"user with this email or login is exist": "Пользователь уже существует",
"user with this login is exist":
"Пользователь с таким логином уже существует",
unauthorized: "Ссылка просрочена",
};
export const parseAxiosError = (nativeError: unknown): [string, number?] => {
@ -27,7 +26,10 @@ export const parseAxiosError = (nativeError: unknown): [string, number?] => {
if ("statusCode" in (error.response?.data as ServerError)) {
SEMessage = serverError?.message.toLowerCase() || "";
}
if ("error" in (error.response?.data as ServerError)) {
if (
"error" in (error.response?.data as ServerError) &&
!("statusCode" in (error.response?.data as ServerError))
) {
SEMessage = serverError?.error.toLowerCase() || "";
}
console.log(serverError);