From 407ad29caded087da6cc560f7cb8faa19789d1a0 Mon Sep 17 00:00:00 2001 From: lo-simon Date: Thu, 30 Jul 2026 17:03:57 +0100 Subject: [PATCH] `activation_time` should not be sent in /staged PATCH requests for IS-05. In IS-05, the activation object fields are: mode requested_time So this new logic should include activation but sanitize it to only schema-valid fields (at minimum, exclude activation_time). --- Development/src/dataProvider.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Development/src/dataProvider.js b/Development/src/dataProvider.js index a5e160c..51e4308 100644 --- a/Development/src/dataProvider.js +++ b/Development/src/dataProvider.js @@ -8,7 +8,7 @@ import { UPDATE, fetchUtils, } from 'react-admin'; -import { assign, get, has, isEmpty, set } from 'lodash'; +import { assign, get, has, isEmpty, pick, set } from 'lodash'; import { JsonPointer } from 'json-ptr'; import diff from 'deep-diff'; import { makeBearerAuthHeader } from './authProvider'; @@ -589,11 +589,12 @@ const convertDataProviderRequestToHTTP = ( // devices that leave activate_immediate on /staged (see #97). A null mode is // only sent when it appears in the differences, so unrelated edits do not // cancel a pending activation. - if (get(params, 'data.$staged.activation.mode') != null) { + const activation = get(params, 'data.$staged.activation'); + if (get(activation, 'mode') != null) { set( patchData, 'activation', - get(params, 'data.$staged.activation') + pick(activation, ['mode', 'requested_time']) ); }