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 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),
}))
)
);
},
};