mirror of
https://github.com/bigchaindb/github-projects.git
synced 2025-01-01 09:37:50 +01:00
fix request options
This commit is contained in:
parent
d09f175ccd
commit
074de3aca0
10
index.js
10
index.js
@ -20,12 +20,12 @@ const handleResponse = res => {
|
|||||||
return res.json()
|
return res.json()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Request headers for all fetch calls
|
// Request options for all fetch calls
|
||||||
const headers = [{
|
const options = {
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/vnd.github.preview'
|
Accept: 'application/vnd.github.preview'
|
||||||
}
|
}
|
||||||
}]
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Fetch all public GitHub repos
|
// Fetch all public GitHub repos
|
||||||
@ -34,7 +34,7 @@ const fetchRepos = () => {
|
|||||||
const start = Date.now()
|
const start = Date.now()
|
||||||
const url = 'https://api.github.com/orgs/' + orgname + '/repos'
|
const url = 'https://api.github.com/orgs/' + orgname + '/repos'
|
||||||
|
|
||||||
fetch(url, headers)
|
fetch(url, options)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
return handleResponse(res)
|
return handleResponse(res)
|
||||||
})
|
})
|
||||||
@ -79,7 +79,7 @@ const fetchReleases = () => {
|
|||||||
const start = Date.now()
|
const start = Date.now()
|
||||||
const url = 'https://api.github.com/repos/bigchaindb/' + reponame + '/releases/latest'
|
const url = 'https://api.github.com/repos/bigchaindb/' + reponame + '/releases/latest'
|
||||||
|
|
||||||
fetch(url, headers)
|
fetch(url, options)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
return handleResponse(res)
|
return handleResponse(res)
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user