Skip to content

Commit

Permalink
Merge pull request #3 from Typeform/os-comments
Browse files Browse the repository at this point in the history
Open Source comments
  • Loading branch information
jepser authored Aug 9, 2018
2 parents 274b4d8 + fe6850e commit 1bfb057
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: node_js

node_js:
- "9"
- "8"

branches:
only:
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"lib": "lib",
"test": "tests"
},
"engines": {
"node": ">=8"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Typeform/js-api-client.git"
Expand All @@ -23,8 +26,7 @@
},
"homepage": "https://github.com/Typeform/js-api-clientk#readme",
"dependencies": {
"axios": "^0.18.0",
"in-publish": "^2.0.0"
"axios": "^0.18.0"
},
"devDependencies": {
"@babel/cli": "^7.0.0-beta.44",
Expand All @@ -43,6 +45,7 @@
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-prettier": "^2.6.0",
"husky": "^0.14.3",
"in-publish": "^2.0.0",
"jest": "^22.4.3",
"lint-staged": "^7.0.4",
"prettier": "^1.12.1",
Expand Down
5 changes: 3 additions & 2 deletions src/create-client.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import axios from 'axios'

export const clientConstructor = ({ token }) => {
export const clientConstructor = ({ token, ...options }) => {
return axios.create({
baseURL: 'https://api.typeform.com',
headers: {
Authorization: `bearer ${token}`
}
},
...options
})
}
5 changes: 3 additions & 2 deletions src/forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ export const getMessages = (http, { uid }) => {
})
}

export const updateMessages = (http, { uid }) => {
export const updateMessages = (http, { uid, data }) => {
return http.request({
method: 'put',
url: `/forms/${uid}/messages`
url: `/forms/${uid}/messages`,
data
})
}

0 comments on commit 1bfb057

Please sign in to comment.