Skip to content

Commit 3942e33

Browse files
authored
Merge pull request #13 from factly/fix/request-errors
fix fetch request errors
2 parents eb2dda6 + 4eed23e commit 3942e33

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

studio/src/actions/metafactsValidly.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ export const getGoogleSheetsValidations = (data) => {
4444
body: raw,
4545
redirect: 'follow',
4646
};
47-
return fetch('http://localhost:8000/expectations/metadata/gsheet', requestOptions)
47+
return fetch(
48+
window.REACT_APP_VALIDLY_SERVER_URL + `/expectations/metadata/gsheet`,
49+
requestOptions,
50+
)
4851
.then((response) => response.json())
4952
.then((validationData) => {
5053
const validationDataArray = getValidationDataArray(validationData);

studio/src/pages/docs/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ const Documentation = () => {
66
const [docs, setDocs] = useState({});
77
const [loading, setLoading] = useState(true);
88
useEffect(() => {
9-
fetch(window.REACT_APP_VALIDLY_SERVER_URL + '/docs/expectations')
9+
let myHeaders = new Headers();
10+
myHeaders.append('Content-Type', 'application/json');
11+
let requestOptions = {
12+
method: 'GET',
13+
headers: myHeaders,
14+
};
15+
fetch(window.REACT_APP_VALIDLY_SERVER_URL + '/docs/expectations/', requestOptions)
1016
.then((response) => response.json())
1117
.then((response) => {
1218
setDocs(response);

0 commit comments

Comments
 (0)