From 2163c4dfc8f82322a15b189f87b71de42f8dd98b Mon Sep 17 00:00:00 2001 From: Michael Albert Date: Mon, 10 Feb 2020 18:06:05 +0100 Subject: [PATCH] Fix user create/update url Change-Id: I33ff191f7e598c29e0b034d5079e9adf05ff80ae --- src/synapse/dataProvider.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/synapse/dataProvider.js b/src/synapse/dataProvider.js index 441f813..50247d8 100644 --- a/src/synapse/dataProvider.js +++ b/src/synapse/dataProvider.js @@ -142,11 +142,11 @@ const dataProvider = { const res = resourceMap[resource]; const homeserver_url = "https://" + homeserver + res.path; - return jsonClient(`${homeserver_url}/${params.id}`, { + return jsonClient(`${homeserver_url}/${params.data.id}`, { method: "PUT", body: JSON.stringify(params.data, filterNullValues), }).then(({ json }) => ({ - data: json, + data: res.map(json), })); }, @@ -174,14 +174,11 @@ const dataProvider = { const res = resourceMap[resource]; const homeserver_url = "https://" + homeserver + res.path; - return jsonClient(`${homeserver_url}/${params.id}`, { + return jsonClient(`${homeserver_url}/${params.data.id}`, { method: "PUT", body: JSON.stringify(params.data, filterNullValues), }).then(({ json }) => ({ - data: { - ...params.data, - id: json.id, - }, + data: res.map(json), })); },