Skip to content

Commit

Permalink
Add docs + Standardize request body and response in routes (#5)
Browse files Browse the repository at this point in the history
* change redirect URL to frontend instead of backend

* add openapi docs + standardize request-body/response
  • Loading branch information
prestonlimlianjie authored Oct 17, 2019
1 parent 252362c commit 0744c1a
Show file tree
Hide file tree
Showing 6 changed files with 921 additions and 32 deletions.
8 changes: 6 additions & 2 deletions classes/File.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,14 @@ class File {
"branch": "staging",
}

await axios.put(endpoint, params, {
const resp = await axios.put(endpoint, params, {
headers: {
Authorization: `token ${this.accessToken}`,
"Content-Type": "application/json"
}
})

return { sha: resp.content.sha }
} catch (err) {
throw err
}
Expand Down Expand Up @@ -106,12 +108,14 @@ class File {
"sha": sha
}

await axios.put(endpoint, params, {
const resp = await axios.put(endpoint, params, {
headers: {
Authorization: `token ${this.accessToken}`,
"Content-Type": "application/json"
}
})

return { newSha: resp.commit.sha }
} catch (err) {
throw err
}
Expand Down
Loading

0 comments on commit 0744c1a

Please sign in to comment.