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

variants fixes #213

Merged
merged 2 commits into from
Sep 25, 2023
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
5 changes: 3 additions & 2 deletions frontend/src/components/Cohorts/Cohorts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import axios from 'axios'
import { useState, useEffect } from 'react'
import Layout from '../Layout/Layout'
import { NavLink, useNavigate } from 'react-router-dom'
import configData from "../../config.json";

function Cohorts (props) {
const API_ENDPOINT = 'https://beacons.bsc.es/beacon-network/v2.0.0/cohorts/'
const API_ENDPOINT = configData.API_URL + "/cohorts"

const [error, setError] = useState(false)
const navigate = useNavigate()
Expand Down Expand Up @@ -508,7 +509,7 @@ function Cohorts (props) {
const fetchDataCohorts = async () => {
try {
let res = await axios.get(
'https://beacons.bsc.es/beacon-network/v2.0.0/cohorts/'
configData.API_URL + "/cohorts"
)

res.data.response.collections.forEach(element => {
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/CrossQueries/CrossQueries.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import './CrossQueries.css';
import axios from "axios";
import { useState, useEffect } from 'react';
import configData from "../../config.json";

function CrossQueries() {
const [valueInitial, setValueInitial] = useState('')
Expand Down Expand Up @@ -39,7 +40,7 @@ function CrossQueries() {
e.preventDefault()
setShowSubmit(false)
try {
let res = await axios.get(`https://beacons.bsc.es/beacon-network/v2.0.0/${valueInitial}/${IdValue}/${valueFinal}`)
let res = await axios.get(configData.API_URL + `/${valueInitial}/${IdValue}/${valueFinal}`)
console.log(res)
res.data.response.resultSets.forEach((element, index) => {
if (res.data.response.resultSets[index].results.length > 0) {
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/Datasets/ResultsDatasets.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import './ResultsDatasets.css'
import axios from "axios";
import { useState, useEffect } from 'react';
import configData from "../../config.json";

function ResultsDatasets(props) {

Expand All @@ -15,7 +16,7 @@ function ResultsDatasets(props) {
const apiCall = async () => {

try {
let res = await axios.get('https://beacons.bsc.es/beacon-network/v2.0.0/info')
let res = await axios.get(configData.API_URL +'/info')
console.log(res.data.responses)
res.data.responses.forEach(element => {
resp.push(element)
Expand Down
Loading