From c377377ac66c7c5d7bd0c60f02bdbedbbf0e3d37 Mon Sep 17 00:00:00 2001 From: Nastya Date: Fri, 16 Feb 2024 21:18:34 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=BC=D0=B5=D0=BD=D1=8B=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D1=81=D1=82=D0=B5=D0=B9=D0=B4=D0=B6=D0=B8=D0=BD?= =?UTF-8?q?=D0=B3=D0=B0=20=D0=B8=20=D0=BF=D1=83=D0=B1=D0=BB=D0=B8=D0=BA?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D0=B8=20=D1=80=D0=B0=D0=B7=D0=BB=D0=B8=D1=87?= =?UTF-8?q?=D0=B0=D1=8E=D1=82=D1=81=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/api/quizRelase.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/api/quizRelase.ts b/lib/api/quizRelase.ts index c294845..9d64cbd 100644 --- a/lib/api/quizRelase.ts +++ b/lib/api/quizRelase.ts @@ -7,6 +7,8 @@ import { QuizSettings } from "@model/settingsData"; let SESSIONS = ""; +const domain = location.hostname ==="localhost" ? "https://s.hbpn.link" : "" + export const publicationMakeRequest = ({ url, body }: any) => { return axios(url, { data: body, @@ -25,7 +27,7 @@ export async function getData(quizId: string): Promise<{ }> { try { const { data, headers } = await axios( - `https://s.hbpn.link/answer/settings`, + domain + `/answer/settings`, { method: "POST", headers: { @@ -91,7 +93,7 @@ export function sendAnswer({ questionId, body, qid }: any) { formData.append("qid", qid); return publicationMakeRequest({ - url: `https://s.hbpn.link/answer/answer`, + url: domain + `/answer/answer`, body: formData, method: "POST", }); @@ -114,7 +116,7 @@ export function sendFile({ questionId, body, qid }: any) { formData.append("qid", qid); return publicationMakeRequest({ - url: `https://s.hbpn.link/answer/answer`, + url: domain + `/answer/answer`, body: formData, method: "POST", }); @@ -143,7 +145,7 @@ export function sendFC({ questionId, body, qid }: any) { formData.append("qid", qid); return publicationMakeRequest({ - url: `https://s.hbpn.link/answer/answer`, + url: domain + `/answer/answer`, body: formData, method: "POST", });