домены для стейджинга и публикации различаются
This commit is contained in:
parent
ba743ff634
commit
c377377ac6
@ -7,6 +7,8 @@ import { QuizSettings } from "@model/settingsData";
|
|||||||
|
|
||||||
let SESSIONS = "";
|
let SESSIONS = "";
|
||||||
|
|
||||||
|
const domain = location.hostname ==="localhost" ? "https://s.hbpn.link" : ""
|
||||||
|
|
||||||
export const publicationMakeRequest = ({ url, body }: any) => {
|
export const publicationMakeRequest = ({ url, body }: any) => {
|
||||||
return axios(url, {
|
return axios(url, {
|
||||||
data: body,
|
data: body,
|
||||||
@ -25,7 +27,7 @@ export async function getData(quizId: string): Promise<{
|
|||||||
}> {
|
}> {
|
||||||
try {
|
try {
|
||||||
const { data, headers } = await axios<GetQuizDataResponse>(
|
const { data, headers } = await axios<GetQuizDataResponse>(
|
||||||
`https://s.hbpn.link/answer/settings`,
|
domain + `/answer/settings`,
|
||||||
{
|
{
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
@ -91,7 +93,7 @@ export function sendAnswer({ questionId, body, qid }: any) {
|
|||||||
formData.append("qid", qid);
|
formData.append("qid", qid);
|
||||||
|
|
||||||
return publicationMakeRequest({
|
return publicationMakeRequest({
|
||||||
url: `https://s.hbpn.link/answer/answer`,
|
url: domain + `/answer/answer`,
|
||||||
body: formData,
|
body: formData,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
});
|
});
|
||||||
@ -114,7 +116,7 @@ export function sendFile({ questionId, body, qid }: any) {
|
|||||||
formData.append("qid", qid);
|
formData.append("qid", qid);
|
||||||
|
|
||||||
return publicationMakeRequest({
|
return publicationMakeRequest({
|
||||||
url: `https://s.hbpn.link/answer/answer`,
|
url: domain + `/answer/answer`,
|
||||||
body: formData,
|
body: formData,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
});
|
});
|
||||||
@ -143,7 +145,7 @@ export function sendFC({ questionId, body, qid }: any) {
|
|||||||
formData.append("qid", qid);
|
formData.append("qid", qid);
|
||||||
|
|
||||||
return publicationMakeRequest({
|
return publicationMakeRequest({
|
||||||
url: `https://s.hbpn.link/answer/answer`,
|
url: domain + `/answer/answer`,
|
||||||
body: formData,
|
body: formData,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user