Skip to content

Commit

Permalink
Merge pull request #213 from EGA-archive/frontend
Browse files Browse the repository at this point in the history
variants fixes
  • Loading branch information
Gemma Milla authored Sep 25, 2023
2 parents 1f9ca20 + 68ffa28 commit fa0961c
Show file tree
Hide file tree
Showing 10 changed files with 308 additions and 251 deletions.
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

0 comments on commit fa0961c

Please sign in to comment.