const fetchScopes = () => { return window.fetch('/api/1.0/main/scope.json').then(response => { if (response.ok) { return response.json(); } }).then(data => { console.log(data); return new Promise((resolve, reject) => { console.log(data); resolve(data.results); }); }); }; export { fetchScopes };