diff --git a/lib/api/quizRelase.ts b/lib/api/quizRelase.ts index 59dc445..92ce9dd 100644 --- a/lib/api/quizRelase.ts +++ b/lib/api/quizRelase.ts @@ -93,18 +93,21 @@ export async function getData({ quizId }: { quizId: string }): Promise<{ if (paudParam) body.auditory = Number(paudParam); try { - const { data, headers } = await axios(domain + `/answer/v1.0.0/settings`, { - method: "POST", - headers: { - "X-Sessionkey": SESSIONS, - "Content-Type": "application/json", - DeviceType: DeviceType, - Device: Device, - OS: OSDevice, - Browser: userAgent, - }, - data: body, - }); + const { data, headers } = await axios( + domain + `/answer/v1.0.0/settings${window.location.search}`, + { + method: "POST", + headers: { + "X-Sessionkey": SESSIONS, + "Content-Type": "application/json", + DeviceType: DeviceType, + Device: Device, + OS: OSDevice, + Browser: userAgent, + }, + data: body, + } + ); const sessions = JSON.parse(localStorage.getItem("sessions") || "{}"); //Тут ещё проверка на антифрод без парса конфига. Нам не интересно время если не нужно запрещать проходить чаще чем в сутки @@ -133,23 +136,26 @@ export async function getDataSingle({ quizId, page }: { quizId: string; page?: n try { // Первый запрос: 1 вопрос + конфиг if (isFirstRequest) { - const { data, headers } = await axios(domain + `/answer/v1.0.0/settings`, { - method: "POST", - headers: { - "X-Sessionkey": SESSIONS, - "Content-Type": "application/json", - DeviceType: DeviceType, - Device: Device, - OS: OSDevice, - Browser: userAgent, - }, - data: { - quiz_id: quizId, - limit: 1, - page: 0, - need_config: true, - }, - }); + const { data, headers } = await axios( + domain + `/answer/v1.0.0/settings${window.location.search}`, + { + method: "POST", + headers: { + "X-Sessionkey": SESSIONS, + "Content-Type": "application/json", + DeviceType: DeviceType, + Device: Device, + OS: OSDevice, + Browser: userAgent, + }, + data: { + quiz_id: quizId, + limit: 1, + page: 0, + need_config: true, + }, + } + ); globalStatus = data.settings.status; isFirstRequest = false; @@ -165,23 +171,26 @@ export async function getDataSingle({ quizId, page }: { quizId: string; page?: n // Если статус не AI - сразу делаем запрос за всеми вопросами if (globalStatus !== "ai") { - const secondResponse = await axios(domain + `/answer/v1.0.0/settings`, { - method: "POST", - headers: { - "X-Sessionkey": SESSIONS, - "Content-Type": "application/json", - DeviceType: DeviceType, - Device: Device, - OS: OSDevice, - Browser: userAgent, - }, - data: { - quiz_id: quizId, - limit: 100, - page: 0, - need_config: false, - }, - }); + const secondResponse = await axios( + domain + `/answer/v1.0.0/settings${window.location.search}`, + { + method: "POST", + headers: { + "X-Sessionkey": SESSIONS, + "Content-Type": "application/json", + DeviceType: DeviceType, + Device: Device, + OS: OSDevice, + Browser: userAgent, + }, + data: { + quiz_id: quizId, + limit: 100, + page: 0, + need_config: false, + }, + } + ); return { data: { ...data, items: secondResponse.data.items }, isRecentlyCompleted: false, @@ -192,7 +201,7 @@ export async function getDataSingle({ quizId, page }: { quizId: string; page?: n } // Последующие запросы - const response = await axios(domain + `/answer/v1.0.0/settings`, { + const response = await axios(domain + `/answer/v1.0.0/settings${window.location.search}`, { method: "POST", headers: { "X-Sessionkey": SESSIONS, diff --git a/public/locales/en.json b/public/locales/en.json index c402ef7..8390ebc 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -53,5 +53,6 @@ "and": "and", "Get results": "Get results", "Data sent successfully": "Data sent successfully", - "Step": "Step" + "Step": "Step", + "questions are not ready yet": "There are no questions for the audience yet. Please wait" } diff --git a/public/locales/ru.json b/public/locales/ru.json index 81a1bae..b8511ff 100644 --- a/public/locales/ru.json +++ b/public/locales/ru.json @@ -53,5 +53,6 @@ "and": "и", "Get results": "Получить результаты", "Data sent successfully": "Данные успешно отправлены", - "Step": "Шаг" + "Step": "Шаг", + "questions are not ready yet": "Вопросы для аудитории ещё не созданы. Пожалуйста, подождите" } diff --git a/public/locales/uz.json b/public/locales/uz.json index d5f52f0..c7d79a5 100644 --- a/public/locales/uz.json +++ b/public/locales/uz.json @@ -53,5 +53,6 @@ "and": "va", "Get results": "Natijalarni olish", "Data sent successfully": "Ma'lumotlar muvaffaqiyatli yuborildi", - "Step": "Qadam" + "Step": "Qadam", + "questions are not ready yet": "Tomoshabinlar uchun hozircha savollar yo'q. Iltimos kuting" }