From 5a88d4ebe10052862cbdcd044f49cd82a039df6b Mon Sep 17 00:00:00 2001 From: John Cowen Date: Tue, 10 Dec 2019 15:47:02 +0000 Subject: [PATCH] ui: Explicitly remove properties that shouldn't be sent when saving (#6917) --- ui-v2/app/adapters/role.js | 16 ++++++++++++++-- ui-v2/app/adapters/token.js | 16 +++++++++++++++- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/ui-v2/app/adapters/role.js b/ui-v2/app/adapters/role.js index e7089640b3..8f271912a3 100644 --- a/ui-v2/app/adapters/role.js +++ b/ui-v2/app/adapters/role.js @@ -25,14 +25,26 @@ export default Adapter.extend({ return request` PUT /v1/acl/role?${{ [API_DATACENTER_KEY]: data[DATACENTER_KEY] }} - ${serialized} + ${{ + Name: serialized.Name, + Description: serialized.Description, + Namespace: serialized.Namespace, + Policies: serialized.Policies, + ServiceIdentities: serialized.ServiceIdentities, + }} `; }, requestForUpdateRecord: function(request, serialized, data) { return request` PUT /v1/acl/role/${data[SLUG_KEY]}?${{ [API_DATACENTER_KEY]: data[DATACENTER_KEY] }} - ${serialized} + ${{ + Name: serialized.Name, + Description: serialized.Description, + Namespace: serialized.Namespace, + Policies: serialized.Policies, + ServiceIdentities: serialized.ServiceIdentities, + }} `; }, requestForDeleteRecord: function(request, serialized, data) { diff --git a/ui-v2/app/adapters/token.js b/ui-v2/app/adapters/token.js index 996c27086d..ee63f4565f 100644 --- a/ui-v2/app/adapters/token.js +++ b/ui-v2/app/adapters/token.js @@ -26,6 +26,14 @@ export default Adapter.extend({ requestForCreateRecord: function(request, serialized, data) { return request` PUT /v1/acl/token?${{ [API_DATACENTER_KEY]: data[DATACENTER_KEY] }} + + ${{ + Description: serialized.Description, + Policies: serialized.Policies, + Roles: serialized.Roles, + ServiceIdentities: serialized.ServiceIdentities, + Local: serialized.Local, + }} `; }, requestForUpdateRecord: function(request, serialized, data) { @@ -45,7 +53,13 @@ export default Adapter.extend({ return request` PUT /v1/acl/token/${data[SLUG_KEY]}?${{ [API_DATACENTER_KEY]: data[DATACENTER_KEY] }} - ${serialized} + ${{ + Description: serialized.Description, + Policies: serialized.Policies, + Roles: serialized.Roles, + ServiceIdentities: serialized.ServiceIdentities, + Local: serialized.Local, + }} `; }, requestForDeleteRecord: function(request, serialized, data) {