Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated the url #5

Merged
merged 3 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/Contestdetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/components/Createcontest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -201,12 +201,12 @@ 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,
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,
Expand Down
2 changes: 1 addition & 1 deletion src/globals.js
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down