From 7470975d0ece31be952517678e4d3e8d93820816 Mon Sep 17 00:00:00 2001 From: robbond Date: Wed, 25 Mar 2026 13:43:08 +0000 Subject: [PATCH] TASK22269: migrate portal deleteMyRepresentations to signed delete helper --- actions/services/portalDirectService.js | 29 +++++++++------------- memory-bank/change-log.md | 33 +++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 18 deletions(-) diff --git a/actions/services/portalDirectService.js b/actions/services/portalDirectService.js index d462f57f..cb063a2d 100644 --- a/actions/services/portalDirectService.js +++ b/actions/services/portalDirectService.js @@ -147,24 +147,17 @@ export const deleteMyRepresentations = (myRepresentationsID) => { myRepresentationsID }); - return buildHashedQueryUrl(queryUrl) - .then((signedUrl) => - requestJson({ - method: "delete", - url: signedUrl, - headers: { - "OData-MaxVersion": "4.0", - "OData-Version": "4.0", - "Accept": "application/json;odata.metadata=none", - "Prefer": - 'odata.include-annotations="*",return=representation', - "Content-Type": "application/json" - } - }) - ) - .catch((error) => { - consoleLogger(error); - }); + return deleteSignedJson(queryUrl, { + headers: { + "OData-MaxVersion": "4.0", + "OData-Version": "4.0", + "Accept": "application/json;odata.metadata=none", + "Prefer": 'odata.include-annotations="*",return=representation', + "Content-Type": "application/json" + } + }).catch((error) => { + consoleLogger(error); + }); }; export const deleteAwaitingSubmissions = (incidentID) => { diff --git a/memory-bank/change-log.md b/memory-bank/change-log.md index 3caa5361..f41fef9f 100644 --- a/memory-bank/change-log.md +++ b/memory-bank/change-log.md @@ -2768,3 +2768,36 @@ Validation: Follow-ups: - Continue Sequence B B1 in future bounded slices by migrating additional signed flows one module/function cluster at a time (outside this slice). + +--- + +### CL-077: TASK22269 Slice B1.2 — portal signed-delete bundle (headered delete migration) + +date: 2026-03-25 +author: Cline +scope: `actions/services/portalDirectService.js` +type: change +rationale: Continue signed-request consolidation using bounded grouping by migrating the remaining portal signed delete flow (`deleteMyRepresentations`) onto shared signed helper while preserving required OData headers. +impact: Further reduces duplicated sign+delete boilerplate in portal service and centralizes signed DELETE execution semantics. +status: completed + +Summary: + +- Migrated `deleteMyRepresentations` from inline `buildHashedQueryUrl(...).then(requestJson(...))` to shared `deleteSignedJson(queryUrl, { headers })`. +- Preserved behavior-critical headers exactly: + - `OData-MaxVersion` + - `OData-Version` + - `Accept` + - `Prefer` + - `Content-Type` +- Preserved existing catch/log behavior (`consoleLogger` with safe undefined return on failure). + +Validation: + +- `npm run lint` -> pass with warnings only (pre-existing `react-hooks/exhaustive-deps`; no new lint errors) +- `node tests/phase22/index.test.cjs` -> pass +- `node tests/phase7/service-behaviour.test.cjs` -> pass (13/13) + +Follow-ups: + +- Next bounded signed GET candidate in portal service is `sendRepCompleteMessage` (single signed URL + GET request path).