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