Merge remote-tracking branch 'origin/staging'
This commit is contained in:
commit
c9d6ec9be4
@ -57,6 +57,9 @@ type PublicationMakeRequestParams = {
|
||||
method: "POST";
|
||||
};
|
||||
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const paudParam = urlParams.get("_paud");
|
||||
|
||||
export const publicationMakeRequest = ({ url, body }: PublicationMakeRequestParams) => {
|
||||
return axios(url, {
|
||||
data: body,
|
||||
@ -75,11 +78,20 @@ export const publicationMakeRequest = ({ url, body }: PublicationMakeRequestPara
|
||||
// Глобальные переменные для хранения состояния между вызовами
|
||||
let globalStatus: string | null = null;
|
||||
let isFirstRequest = true;
|
||||
|
||||
export async function getData({ quizId }: { quizId: string }): Promise<{
|
||||
data: GetQuizDataResponse | null;
|
||||
isRecentlyCompleted: boolean;
|
||||
error?: AxiosError;
|
||||
}> {
|
||||
const body = {
|
||||
quiz_id: quizId,
|
||||
limit: 100,
|
||||
page: 0,
|
||||
need_config: true,
|
||||
} as any;
|
||||
if (paudParam) body.auditory = Number(paudParam);
|
||||
|
||||
try {
|
||||
const { data, headers } = await axios<GetQuizDataResponse>(
|
||||
domain + `/answer/v1.0.0/settings${window.location.search}`,
|
||||
@ -93,12 +105,7 @@ export async function getData({ quizId }: { quizId: string }): Promise<{
|
||||
OS: OSDevice,
|
||||
Browser: userAgent,
|
||||
},
|
||||
data: {
|
||||
quiz_id: quizId,
|
||||
limit: 100,
|
||||
page: 0,
|
||||
need_config: true,
|
||||
},
|
||||
data: body,
|
||||
}
|
||||
);
|
||||
const sessions = JSON.parse(localStorage.getItem("sessions") || "{}");
|
||||
@ -120,6 +127,7 @@ export async function getData({ quizId }: { quizId: string }): Promise<{
|
||||
return { data: null, isRecentlyCompleted: false, error: error };
|
||||
}
|
||||
}
|
||||
|
||||
export async function getDataSingle({ quizId, page }: { quizId: string; page?: number }): Promise<{
|
||||
data: GetQuizDataResponse | null;
|
||||
isRecentlyCompleted: boolean;
|
||||
|
@ -167,6 +167,7 @@ export const ContactForm = ({ currentQuestion, onShowResult }: Props) => {
|
||||
if (settings.cfg.resultInfo.showResultForm === "after") {
|
||||
onShowResult();
|
||||
}
|
||||
enqueueSnackbar(t("Data sent successfully"));
|
||||
}
|
||||
|
||||
setFire(false);
|
||||
|
@ -119,5 +119,6 @@
|
||||
},
|
||||
"lint-staged": {
|
||||
"*": "prettier --write --ignore-unknown"
|
||||
}
|
||||
},
|
||||
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
||||
}
|
||||
|
@ -52,7 +52,7 @@
|
||||
"familiarized": "acknowledged",
|
||||
"and": "and",
|
||||
"Get results": "Get results",
|
||||
"Data sent successfully": "Data sent successfully",
|
||||
"Step": "Step",
|
||||
"D": "-_-",
|
||||
"d": "-_-"
|
||||
"questions are not ready yet": "There are no questions for the audience yet. Please wait"
|
||||
}
|
||||
|
@ -55,5 +55,6 @@
|
||||
"Data sent successfully": "Данные успешно отправлены",
|
||||
"Step": "Шаг",
|
||||
"neftyanka FK": "Заполните форму, чтобы отправить ваши ответы на викторину",
|
||||
"neftyanka button": "Отправить"
|
||||
"neftyanka button": "Отправить",
|
||||
"questions are not ready yet": "Вопросы для аудитории ещё не созданы. Пожалуйста, подождите"
|
||||
}
|
||||
|
@ -52,7 +52,7 @@
|
||||
"familiarized": "tanishdim",
|
||||
"and": "va",
|
||||
"Get results": "Natijalarni olish",
|
||||
"Data sent successfully": "Ma'lumotlar muvaffaqiyatli yuborildi",
|
||||
"Step": "Qadam",
|
||||
"D": "-_-",
|
||||
"d": "-_-"
|
||||
"questions are not ready yet": "Tomoshabinlar uchun hozircha savollar yo'q. Iltimos kuting"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user