From 6dd91293e3ed787d5caa28fcae7e0a2cc440e9c6 Mon Sep 17 00:00:00 2001 From: Max Stemplinger Date: Mon, 5 Nov 2018 18:06:58 +0100 Subject: [PATCH] added update translations method to update multiple translations at once --- README.md | 1 + src/index.js | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/README.md b/README.md index 1f4f176..15a2f12 100644 --- a/README.md +++ b/README.md @@ -154,6 +154,7 @@ Find the [docs here](https://apertureless.github.io/shopware-api-client/#/) *con - .getTranslation(id, [callback]) 🔀 `Promise` - .createTranslation(id, body, [callback]) 🔀 `Promise` - .updateTranslation(id, body, [callback]) 🔀 `Promise` + - .updateTranslations(body, [callback]) 🔀 `Promise` - .deleteTranslation(id, [callback]) 🔀 `Promise` ## Contributing diff --git a/src/index.js b/src/index.js index 511152c..80101b9 100644 --- a/src/index.js +++ b/src/index.js @@ -894,6 +894,18 @@ class Shopware { }) } + updateTranslations(body) { + if (!body) { + return handleError(ERROR.MISSING_BODY) + } + + return this.handleRequest({ + url: `translations/`, + method: 'PUT', + body + }) + } + deleteTranslation(id) { if (!id) { return handleError(ERROR.MISSING_ID)