Fix deleteMany() in dataProvider (#6)

Change-Id: I6ef3abbf3ed7a1860b7c395d91fda8b7e44f4d95
This commit is contained in:
Lukas Winkler 2020-02-10 19:20:20 +01:00 committed by Manuel Stahl
parent 2163c4dfc8
commit 726461aa19

View file

@ -204,13 +204,15 @@ const dataProvider = {
const res = resourceMap[resource]; const res = resourceMap[resource];
const homeserver_url = "https://" + homeserver + res.path; const homeserver_url = "https://" + homeserver + res.path;
return Promise.all( return Promise.all(
params.ids.map(id => jsonClient(`${homeserver_url}/${id}`), { params.ids.map(id =>
method: "DELETE", jsonClient(`${homeserver_url}/${id}`, {
body: JSON.stringify(params.data, filterNullValues), method: "DELETE",
}) body: JSON.stringify(params.data, filterNullValues),
).then(responses => ({ }).then(responses => ({
data: responses.map(({ json }) => json), data: responses.map(({ json }) => json),
})); }))
)
);
}, },
}; };