Skip to content

Commit

Permalink
πŸ’Ž Release new version 1.0.0
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Juszczak <[email protected]>
  • Loading branch information
apertureless committed Feb 22, 2017
1 parent c0d8201 commit 776ddd6
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 2 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ shop.getArticles()
- [x] `/api/orders`
- [x] `/api/propertyGroups`
- [x] `/api/shops`
- [ ] `/api/translations`
- [x] `/api/translations`
- [x] `/api/variants`
- [x] `/api/version`

Expand Down Expand Up @@ -141,6 +141,11 @@ shop.getArticles()
- .createShop(body, [callback]) πŸ”€ `Promise`
- .updateShop(id, body, [callback]) πŸ”€ `Promise`
- .deleteShop(id, [callback]) πŸ”€ `Promise`
- .getTranslations([callback]) πŸ”€ `Promise`
- .getTranslation(id, [callback]) πŸ”€ `Promise`
- .createTranslation(id, body, [callback]) πŸ”€ `Promise`
- .updateTranslation(id, body, [callback]) πŸ”€ `Promise`
- .deleteTranslation(id, [callback]) πŸ”€ `Promise`

<a name="new_shopware"></a>

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "shopware-api-client",
"version": "0.6.0",
"version": "1.0.0",
"description": "node client for shopware api",
"main": "dist/index.js",
"author": "Jakub Juszczak <[email protected]>",
Expand Down
61 changes: 61 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,67 @@ class Shopware {
})
}

getTranslations() {
return this.handleRequest({
url: 'translations/',
method: 'GET'
}, 'data')
}

getTranslation(id) {
if (!id) {
return handleError(ERROR.MISSING_ID)
}

return this.handleRequest({
url: `translations/${id}`,
method: 'GET'
}, 'data')
}

createTranslation(id, body) {
if (!id) {
return handleError(ERROR.MISSING_ID)
}

if (!body) {
return handleError(ERROR.MISSING_BODY)
}

return this.handleRequest({
url: `translations/${id}`,
method: 'POST',
body
})
}

updateTranslation(id, body) {
if (!id) {
return handleError(ERROR.MISSING_ID)
}

if (!body) {
return handleError(ERROR.MISSING_BODY)
}

return this.handleRequest({
url: `translations/${id}`,
method: 'PUT',
body
})
}

deleteTranslation(id) {
if (!id) {
return handleError(ERROR.MISSING_ID)
}

return this.handleRequest({
url: `translations/${id}`,
method: 'DELETE'
})
}

}

module.exports = Shopware

0 comments on commit 776ddd6

Please sign in to comment.