Skip to content
Open

Done #143

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
33 changes: 30 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,49 @@
const token = ''

function getIssues() {
const repo = 'https:/api.github.com\/repos\/eltuttle\/javascript-fetch-lab\/issues'
fetch(repo, {
headers: {
Authorization: `token ${token}`
}
}).then(res => console.log(res))
}

function showIssues(json) {
}

function createIssue() {
var title = document.getElementById('title').value
var body = document.getElementById('body').value
const postData = {
title: title,
body: body
};
const repo = 'https:/api.github.com\/repos\/eltuttle\/javascript-fetch-lab\/issues'
fetch(repo, {
method: 'post',
body: JSON.stringify(postData),
headers: {
Authorization: `token ${token}`
}
}).then(res => console.log(res))//.then(json => console.log(json));
}

function showResults(json) {
}

function forkRepo() {
const repo = 'learn-co-curriculum/javascript-fetch-lab'
//use fetch to fork it!
const repo = 'https:/api.github.com\/repos\/learn-co-curriculum\/javascript-fetch-lab/forks'
fetch(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 ''
return '';
}