From 726461aa19b1ae8af7ec02efc594a7ff74025b16 Mon Sep 17 00:00:00 2001 From: Lukas Winkler Date: Mon, 10 Feb 2020 19:20:20 +0100 Subject: [PATCH] Fix deleteMany() in dataProvider (#6) Change-Id: I6ef3abbf3ed7a1860b7c395d91fda8b7e44f4d95 --- src/synapse/dataProvider.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/synapse/dataProvider.js b/src/synapse/dataProvider.js index 50247d8..45ffc3f 100644 --- a/src/synapse/dataProvider.js +++ b/src/synapse/dataProvider.js @@ -204,13 +204,15 @@ const dataProvider = { const res = resourceMap[resource]; const homeserver_url = "https://" + homeserver + res.path; return Promise.all( - params.ids.map(id => jsonClient(`${homeserver_url}/${id}`), { - method: "DELETE", - body: JSON.stringify(params.data, filterNullValues), - }) - ).then(responses => ({ - data: responses.map(({ json }) => json), - })); + params.ids.map(id => + jsonClient(`${homeserver_url}/${id}`, { + method: "DELETE", + body: JSON.stringify(params.data, filterNullValues), + }).then(responses => ({ + data: responses.map(({ json }) => json), + })) + ) + ); }, };