при нехватке денег за тариф кидает на хаб
This commit is contained in:
parent
dcc2bc3cb7
commit
c4db4a80af
@ -87,10 +87,8 @@ export async function recover(
|
||||
useToken: false,
|
||||
withCredentials: true,
|
||||
});
|
||||
console.log(recoverResponse);
|
||||
return [recoverResponse];
|
||||
} catch (nativeError) {
|
||||
console.log(nativeError);
|
||||
const [error] = parseAxiosError(nativeError);
|
||||
|
||||
return [null, `Не удалось восстановить пароль. ${error}`];
|
||||
|
@ -62,7 +62,6 @@ export const DesignPage = () => {
|
||||
setCurrentStep(index);
|
||||
};
|
||||
|
||||
console.log(quiz);
|
||||
if (quiz === undefined)
|
||||
return (
|
||||
<Skeleton sx={{ width: "100vw", height: "100vh", transform: "none" }} />
|
||||
|
@ -56,7 +56,6 @@ export default function ButtonsOptionsAndPict({
|
||||
openBranchingPage,
|
||||
setOpenBranchingPage,
|
||||
}: Props) {
|
||||
console.log(setOpenBranchingPage);
|
||||
const [buttonHover, setButtonHover] = useState<string>("");
|
||||
const [openedReallyChangingModal, setOpenedReallyChangingModal] =
|
||||
useState<boolean>(false);
|
||||
|
@ -19,7 +19,6 @@ export default function AnswerOptions({
|
||||
openBranchingPage,
|
||||
setOpenBranchingPage,
|
||||
}: Props) {
|
||||
console.log(setOpenBranchingPage);
|
||||
const onClickAddAnAnswer = useAddAnswer();
|
||||
const [switchState, setSwitchState] = useState("setting");
|
||||
const theme = useTheme();
|
||||
|
@ -19,7 +19,6 @@ export const Tabs = ({
|
||||
TabIndicatorProps={{ sx: { display: "none" } }}
|
||||
value={selectedItem}
|
||||
onChange={(event, newValue: "count" | "day") => {
|
||||
console.log(newValue);
|
||||
setSelectedItem(newValue);
|
||||
}}
|
||||
variant="scrollable"
|
||||
|
@ -69,12 +69,10 @@ function TariffPage() {
|
||||
process.env.REACT_APP_DOMAIN +
|
||||
`/strator/tariff?page=${page}&limit=100`,
|
||||
});
|
||||
console.log(page);
|
||||
|
||||
tariffsList.push(...tariffsResult.tariffs);
|
||||
}
|
||||
|
||||
console.log("это то что мы отдаём перед концом", tariffsList);
|
||||
return tariffsList;
|
||||
};
|
||||
|
||||
@ -90,7 +88,6 @@ function TariffPage() {
|
||||
url: process.env.REACT_APP_DOMAIN + "/price/discounts",
|
||||
});
|
||||
setUser(user);
|
||||
console.log("это то что мы получили в самом конце", tariffsList);
|
||||
setTariffs(tariffsList);
|
||||
setDiscounts(discounts.Discounts);
|
||||
let c = currencyFormatter.format(Number(user.wallet.cash) / 100);
|
||||
@ -133,18 +130,15 @@ function TariffPage() {
|
||||
|
||||
var link = document.createElement("a");
|
||||
link.href =
|
||||
process.env.REACT_APP_DOMAIN +
|
||||
"https://hub.pena.digital" +
|
||||
`/payment?action=squizpay&dif=${
|
||||
(price - Number(user.wallet.cash)) * 100
|
||||
}`;
|
||||
document.body.appendChild(link);
|
||||
// link.click();
|
||||
link.click();
|
||||
}
|
||||
};
|
||||
|
||||
const purchasesAmount = user?.wallet.purchasesAmount ?? 0;
|
||||
const isUserNko = user?.status === "nko";
|
||||
console.log(tariffs);
|
||||
const filteredTariffs = tariffs.filter((tariff) => {
|
||||
return (
|
||||
tariff.privileges[0].serviceKey === "squiz" &&
|
||||
@ -153,7 +147,6 @@ function TariffPage() {
|
||||
tariff.privileges[0]?.type === selectedItem
|
||||
);
|
||||
});
|
||||
console.log(filteredTariffs);
|
||||
|
||||
async function handleLogoutClick() {
|
||||
const [, logoutError] = await logout();
|
||||
|
@ -111,10 +111,8 @@ export const Footer = ({
|
||||
}, [question, answers]);
|
||||
|
||||
const showResult = (nextQuestion: QuizQuestionResult) => {
|
||||
console.log("Следующий результат будет вот такой", nextQuestion);
|
||||
|
||||
const isEmpty = checkEmptyData({ resultData: nextQuestion });
|
||||
console.log("isEmpty", isEmpty);
|
||||
if (nextQuestion) {
|
||||
if (nextQuestion && quiz?.config.resultInfo.showResultForm === "before") {
|
||||
if (isEmpty) {
|
||||
@ -134,8 +132,6 @@ export const Footer = ({
|
||||
};
|
||||
|
||||
const getNextQuestionId = () => {
|
||||
console.log("net");
|
||||
console.log(question);
|
||||
let readyBeNextQuestion = "";
|
||||
|
||||
//вопрос обязателен, анализируем ответ и условия ветвления
|
||||
@ -182,7 +178,6 @@ export const Footer = ({
|
||||
|
||||
if (!question.required) {
|
||||
//вопрос не обязателен и не нашли совпадений между ответами и условиями ветвления
|
||||
console.log("вопрос не обязателен ищем дальше");
|
||||
const defaultQ = question.content.rule.default;
|
||||
if (defaultQ.length > 1 && defaultQ !== " ") return defaultQ;
|
||||
//Вопросы типа страница, ползунок, своё поле для ввода и дата не могут иметь больше 1 ребёнка. Пользователь не может настроить там дефолт
|
||||
@ -197,13 +192,7 @@ export const Footer = ({
|
||||
return question.content.rule.children[0];
|
||||
}
|
||||
//ничё не нашли, ищем резулт
|
||||
console.log("ничё не нашли, ищем резулт ");
|
||||
return questions.find((q) => {
|
||||
console.log('q.type === "result"', q.type === "result");
|
||||
console.log(
|
||||
"q.content.rule.parentId === question.content.id",
|
||||
q.content.rule.parentId === question.content.id,
|
||||
);
|
||||
return (
|
||||
q.type === "result" && q.content.rule.parentId === question.content.id
|
||||
);
|
||||
@ -237,7 +226,6 @@ export const Footer = ({
|
||||
};
|
||||
|
||||
const followNextStep = () => {
|
||||
console.log(" Я понимаю что нахожусь в линейном опроснике" + linear);
|
||||
if (linear) {
|
||||
setStepNumber((q) => q + 1);
|
||||
const questionIndex = questions.findIndex(({ id }) => id === question.id);
|
||||
@ -253,10 +241,8 @@ export const Footer = ({
|
||||
|
||||
const nextQuestionId = getNextQuestionId();
|
||||
|
||||
console.log(nextQuestionId);
|
||||
if (nextQuestionId) {
|
||||
const nextQuestion = getQuestionByContentId(nextQuestionId);
|
||||
console.log(nextQuestion);
|
||||
|
||||
if (nextQuestion?.type && nextQuestion.type === "result") {
|
||||
showResult(nextQuestion);
|
||||
|
@ -66,7 +66,6 @@ export const ResultForm = ({
|
||||
};
|
||||
if (resultQuestion === undefined) return <></>;
|
||||
|
||||
console.log("Я форма показа резултата и он такой ", resultQuestion);
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
|
@ -30,7 +30,6 @@ export const StartPageViewPublication = ({ setVisualStartPage }: Props) => {
|
||||
|
||||
if (!quiz) return null;
|
||||
|
||||
console.log(quiz);
|
||||
|
||||
const handleCopyNumber = () => {
|
||||
navigator.clipboard.writeText(quiz.config.info.phonenumber);
|
||||
@ -85,7 +84,6 @@ export const StartPageViewPublication = ({ setVisualStartPage }: Props) => {
|
||||
) : null
|
||||
) : null;
|
||||
|
||||
console.log(background);
|
||||
|
||||
return (
|
||||
<Paper
|
||||
|
@ -72,7 +72,6 @@ export const Images = ({ currentQuestion }: ImagesProps) => {
|
||||
}}
|
||||
onClick={(event) => {
|
||||
event.preventDefault();
|
||||
console.log(variant.answer.length);
|
||||
updateAnswer(
|
||||
currentQuestion.content.id,
|
||||
currentQuestion.content.variants[index].id,
|
||||
|
@ -81,7 +81,6 @@ export default function RecoverPassword() {
|
||||
setAuthToken("");
|
||||
};
|
||||
}, []);
|
||||
console.log(tokenUser);
|
||||
|
||||
function handleClose() {
|
||||
setIsDialogOpen(false);
|
||||
|
@ -56,7 +56,6 @@ export default function Main({ sidebar, header, footer, Page }: Props) {
|
||||
)
|
||||
) {
|
||||
createResult(quiz?.backendId, "line");
|
||||
console.log("Я не нашёл линейный резулт и собираюсь создать новый");
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -106,7 +105,6 @@ export default function Main({ sidebar, header, footer, Page }: Props) {
|
||||
useEffect(() => {
|
||||
if (mainBlock.current) observer.current.observe(mainBlock.current);
|
||||
}, [mainBlock, observer]);
|
||||
console.log(widthMain);
|
||||
|
||||
if (!quizConfig) return <></>;
|
||||
return (
|
||||
|
@ -20,10 +20,7 @@ const translateMessage: Record<string, string> = {
|
||||
};
|
||||
|
||||
export const parseAxiosError = (nativeError: unknown): [string, number?] => {
|
||||
console.log(nativeError);
|
||||
const error = nativeError as AxiosError;
|
||||
console.log(error);
|
||||
console.log(error.response?.data);
|
||||
if (error.response?.data) {
|
||||
const serverError = error.response.data as ServerError;
|
||||
let SEMessage;
|
||||
|
Loading…
Reference in New Issue
Block a user