TASK22269: reuse azurestorage path builders in touched blob object fields
This commit is contained in:
+22
-28
@@ -281,25 +281,21 @@ export const getBlobs = async (containerName, casefolderID) => {
|
||||
"size": blob.properties.contentLength,
|
||||
"contentType": blob.contentType,
|
||||
"lastModified": blob.properties.lastModified,
|
||||
"filepath":
|
||||
"/api/file/downloadblob?container=" +
|
||||
containerName +
|
||||
"&casefolderID=" +
|
||||
encodeURIComponent(casefolderID) +
|
||||
"&blobname=" +
|
||||
encodeURIComponent(blob.name),
|
||||
"filepath": buildDownloadBlobQueryPath({
|
||||
containerName,
|
||||
casefolderID,
|
||||
blobname: blob.name
|
||||
}),
|
||||
...buildHashMetadataPaths({
|
||||
containerName,
|
||||
casefolderID,
|
||||
blobname: fileName
|
||||
}),
|
||||
"deletepath":
|
||||
"/api/file/deleteblob?container=" +
|
||||
containerName +
|
||||
"&casefolderID=" +
|
||||
encodeURIComponent(casefolderID) +
|
||||
"&blobname=" +
|
||||
encodeURIComponent(fileName)
|
||||
"deletepath": buildDeleteBlobQueryPath({
|
||||
containerName,
|
||||
casefolderID,
|
||||
blobname: fileName
|
||||
})
|
||||
});
|
||||
}
|
||||
//console.log("blobObj:", blobObj);
|
||||
@@ -1487,25 +1483,23 @@ export const getRepsFilesBlobs = async (
|
||||
"isCurrentVersion": blob.isCurrentVersion,
|
||||
"contentLength": blob.properties.contentLength,
|
||||
"filenameprefix": filenamePrefix,
|
||||
"filepath":
|
||||
"/api/file/downloadblob?container=" +
|
||||
containerName +
|
||||
"&casefolderID=" +
|
||||
encodeURIComponent(casefolderPath) +
|
||||
"&blobname=" +
|
||||
encodeURIComponent(repFileName),
|
||||
"filepath": buildDownloadBlobQueryPath({
|
||||
containerName,
|
||||
casefolderID: casefolderPath,
|
||||
blobname: repFileName
|
||||
}),
|
||||
...buildHashMetadataPaths({
|
||||
containerName,
|
||||
casefolderID: casefolderPath,
|
||||
blobname: repFileName
|
||||
}),
|
||||
"deletepath":
|
||||
"/api/file/deleteblob?container=" +
|
||||
containerName +
|
||||
"&casefolderID=" +
|
||||
casefolderPath +
|
||||
"&blobname=" +
|
||||
repFileName
|
||||
"deletepath": buildDeleteBlobQueryPath({
|
||||
containerName,
|
||||
casefolderID: casefolderPath,
|
||||
blobname: repFileName,
|
||||
encodeCasefolderID: false,
|
||||
encodeBlobname: false
|
||||
})
|
||||
});
|
||||
}
|
||||
consoleLogger("blobObj:", blobObj);
|
||||
|
||||
@@ -3100,3 +3100,35 @@ Validation:
|
||||
Follow-ups:
|
||||
|
||||
- Optional next bounded slice: align remaining low-risk direct `console.log` calls in these functions to `consoleLogger` only where already touched and safe.
|
||||
|
||||
---
|
||||
|
||||
### CL-087: TASK22269 Slice B1.12 — azurestorage touched-function path assembly helper reuse
|
||||
|
||||
date: 2026-03-26
|
||||
author: Cline
|
||||
scope: `actions/azurestorage.js`
|
||||
type: change
|
||||
rationale: Execute the next bounded maintainability slice by reusing existing local query-path helpers for touched `filepath`/`deletepath` assembly, reducing repeated literal concatenation.
|
||||
impact: Readability/consistency improvement only; preserves query parameter values and route behavior.
|
||||
status: completed
|
||||
|
||||
Summary:
|
||||
|
||||
- In touched functions:
|
||||
- `getBlobs`
|
||||
- `getRepsFilesBlobs`
|
||||
- Replaced inline `filepath` string concatenation with `buildDownloadBlobQueryPath(...)`.
|
||||
- Replaced inline `deletepath` string concatenation with `buildDeleteBlobQueryPath(...)`.
|
||||
- Preserved previous encoding behavior where required by passing explicit options:
|
||||
- kept non-encoded `casefolderID`/`blobname` behavior in `getRepsFilesBlobs.deletepath` via helper options.
|
||||
|
||||
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:
|
||||
|
||||
- Optional next bounded slice: targeted helper-consumer tidy in the same functions for any remaining repeated query-path literals outside touched object fields.
|
||||
|
||||
Reference in New Issue
Block a user