Skip to content
Open

Done #137

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,41 @@
function getIssues() {
fetch('javascript-fetch-lab/issues', {
headers: {
Authorization: `token ${token}`
}
}).then(res => res.json()).then(json => console.log(json));
}

function showIssues(json) {
}

function createIssue() {
fetch('javascript-fetch-lab/issues', {
method: 'post',
body: 'test body',
headers: {
Authorization: `token ${token}`
}
}).then(res => res.json()).then(json => console.log(json));
}

function showResults(json) {
}

function forkRepo() {
const repo = 'learn-co-curriculum/javascript-fetch-lab'
//use fetch to fork it!
fetch('/api.github.com/repos/' + repo, {
method: 'post',
headers: {
Authorization: `token ${token}`
}
}).then(res => res.json()).then(json => console.log(json));
}

function getToken() {
//change to your token to run in browser, but set
//back to '' before committing so all tests pass
return ''
}

const token = getToken();