refactor(actions): adopt endpoint client in portal config helpers
This commit is contained in:
@@ -159,13 +159,9 @@ export const deleteAwaitingSubmissions = (incidentID) => {
|
|||||||
url: queryUrl
|
url: queryUrl
|
||||||
};
|
};
|
||||||
|
|
||||||
return axios(config)
|
return requestJson(config).catch((error) => {
|
||||||
.then((res) => {
|
consoleLogger(error);
|
||||||
return res.data;
|
});
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
consoleLogger(error);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const deleteWatchedCases = async (watchedCaseID) => {
|
export const deleteWatchedCases = async (watchedCaseID) => {
|
||||||
@@ -215,13 +211,9 @@ export const sendCaseCompleteMessage = async (
|
|||||||
url: queryUrl
|
url: queryUrl
|
||||||
};
|
};
|
||||||
|
|
||||||
return axios(config)
|
return requestJson(config).catch((error) => {
|
||||||
.then((res) => {
|
consoleLogger(error);
|
||||||
return res.data;
|
});
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
consoleLogger(error);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const sendCaseCompleteMessageProxy = async (
|
export const sendCaseCompleteMessageProxy = async (
|
||||||
@@ -239,13 +231,9 @@ export const sendCaseCompleteMessageProxy = async (
|
|||||||
url: queryUrl
|
url: queryUrl
|
||||||
};
|
};
|
||||||
|
|
||||||
return axios(config)
|
return requestJson(config).catch((error) => {
|
||||||
.then((res) => {
|
consoleLogger(error);
|
||||||
return res.data;
|
});
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
consoleLogger(error);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const sendRepCompleteMessage = async (
|
export const sendRepCompleteMessage = async (
|
||||||
@@ -268,13 +256,9 @@ export const sendRepCompleteMessage = async (
|
|||||||
url: queryUrl
|
url: queryUrl
|
||||||
};
|
};
|
||||||
|
|
||||||
return axios(config)
|
return requestJson(config).catch((error) => {
|
||||||
.then((res) => {
|
consoleLogger(error);
|
||||||
return res.data;
|
});
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
consoleLogger(error);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const setRepInvolvment = async (caseid, contactid) => {
|
export const setRepInvolvment = async (caseid, contactid) => {
|
||||||
|
|||||||
@@ -1860,3 +1860,35 @@ Validation:
|
|||||||
Follow-ups:
|
Follow-ups:
|
||||||
|
|
||||||
- Optional next bounded slice: review other direct service modules for any remaining legacy `axios` import usage now that case service migration is complete.
|
- Optional next bounded slice: review other direct service modules for any remaining legacy `axios` import usage now that case service migration is complete.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### CL-052: TASK22260 next slice — portal direct service requestJson parity for config-based reads/deletes
|
||||||
|
|
||||||
|
date: 2026-03-25
|
||||||
|
author: Cline
|
||||||
|
scope: `actions/services/portalDirectService.js`
|
||||||
|
type: change
|
||||||
|
rationale: Continue bounded direct-service consistency by migrating remaining config-based portal helper calls from `axios(config)` to shared `requestJson(...)` where no signed-delete/header-specific behavior is required.
|
||||||
|
impact: Reduces repeated config execution/response extraction boilerplate and improves request helper consistency in portal service while preserving behavior.
|
||||||
|
status: completed
|
||||||
|
|
||||||
|
Summary:
|
||||||
|
|
||||||
|
- Migrated selected config-based helpers to `requestJson(config)`:
|
||||||
|
- `deleteAwaitingSubmissions`
|
||||||
|
- `sendCaseCompleteMessage`
|
||||||
|
- `sendCaseCompleteMessageProxy`
|
||||||
|
- `sendRepCompleteMessage`
|
||||||
|
- Preserved behavior contracts:
|
||||||
|
- unchanged query/hash composition and request methods
|
||||||
|
- unchanged catch-path logging via `consoleLogger`
|
||||||
|
- left signed delete helpers with bespoke axios/header behavior unchanged (`deleteMyRepresentations`, `deleteWatchedCases`)
|
||||||
|
|
||||||
|
Validation:
|
||||||
|
|
||||||
|
- `npm run lint` -> warnings only (pre-existing `react-hooks/exhaustive-deps`; no new lint errors)
|
||||||
|
|
||||||
|
Follow-ups:
|
||||||
|
|
||||||
|
- Optional next bounded slice: assess whether signed-delete helpers in `portalDirectService` should remain explicit axios calls (for clarity on headers/hash semantics) or move to a dedicated signed-request client helper.
|
||||||
|
|||||||
Reference in New Issue
Block a user