From b32653c91b0955c12e7b7a9c91fd8fff901a615c Mon Sep 17 00:00:00 2001 From: Sathishsathi Date: Sun, 22 Dec 2024 16:05:25 +0530 Subject: [PATCH 1/2] updated the url --- src/components/Contestdetails.vue | 4 ++-- src/components/Createcontest.vue | 4 ++-- src/globals.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/Contestdetails.vue b/src/components/Contestdetails.vue index 97a806c..6f58f07 100644 --- a/src/components/Contestdetails.vue +++ b/src/components/Contestdetails.vue @@ -85,7 +85,7 @@ import axios from 'axios'; import Contest from './Contest.vue'; -import API_URL from '../globals.js'; +import globals from '../globals.js'; export default { name: 'Contestdetails', @@ -101,7 +101,7 @@ export default { // const contestId = this.$route.params.id; // Make GET request using the emitted URL - axios.get(API_URL + "/api/contest/" + 1) + axios.get(globals.API_URL + "/api/contest/" + 1) .then(response => { const data = response.data; this.administrators = data.adminstrators; diff --git a/src/components/Createcontest.vue b/src/components/Createcontest.vue index eecb167..d35474e 100644 --- a/src/components/Createcontest.vue +++ b/src/components/Createcontest.vue @@ -108,7 +108,7 @@ let pageValidationPass = ref(false); // API call to get dynamic options based on input const fetchOptions = async (query) => { try { - jsonp(`${globals.WIKIPEDIA_API_URL}?action=query&format=json&list=allusers&auprefix=${query}`, null, function (err, data) { + jsonp(`${globals.USER_API_URL}?action=query&format=json&list=allusers&auprefix=${query}`, null, function (err, data) { if (err) { console.error(err.message); } else { @@ -201,7 +201,7 @@ const post = async () => { } const response = await axios.post( - globals.API_URL + "/contest/create", + globals.API_URL + "/api/contest/create", { name: contestInfo.value, language: contestLang.value, diff --git a/src/globals.js b/src/globals.js index 3662e2f..e917764 100644 --- a/src/globals.js +++ b/src/globals.js @@ -1,4 +1,4 @@ -const API_URL = "http://localhost:5000"; +const API_URL = "http://127.0.0.1:5000"; const USER_API_URL = "https://en.wikipedia.org/w/api.php"; const WIKISOURCE_API_URL = "https://en.wikisource.org/w/api.php"; export default { From b0efa72ec7e23b53b845841fc1eb8e8edf871031 Mon Sep 17 00:00:00 2001 From: Sathishsathi Date: Sun, 22 Dec 2024 16:12:57 +0530 Subject: [PATCH 2/2] updated the string trimming --- src/components/Createcontest.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Createcontest.vue b/src/components/Createcontest.vue index d35474e..783623b 100644 --- a/src/components/Createcontest.vue +++ b/src/components/Createcontest.vue @@ -206,7 +206,7 @@ const post = async () => { name: contestInfo.value, language: contestLang.value, start_date: startDate.value, - book_names: indexPages.value, + book_names: indexPages.value.trim().replace(/[\n\r]+/g, ''), end_date: endDate.value, admins: adminUsernames, // Send selected admins proofread_points: stov.value,