gonito-frontend/src/api/getMyEntries.js

17 lines
564 B
JavaScript
Raw Normal View History

2022-10-14 11:35:48 +02:00
import {API} from '../utils/globals';
import KeyCloakService from '../services/KeyCloakService';
const getMyEntries = (challengeName, setDataState, setLoadingState) => {
fetch(`${API}/challenge-my-submissions/${challengeName}`, {
headers: {'Authorization': `Bearer ${KeyCloakService.getToken()}`}
})
.then(response => response.json())
.then(data => {
console.log(data);
setDataState(data);
if (setLoadingState)
setLoadingState(false);
});
};
export default getMyEntries;