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,
|
"size": blob.properties.contentLength,
|
||||||
"contentType": blob.contentType,
|
"contentType": blob.contentType,
|
||||||
"lastModified": blob.properties.lastModified,
|
"lastModified": blob.properties.lastModified,
|
||||||
"filepath":
|
"filepath": buildDownloadBlobQueryPath({
|
||||||
"/api/file/downloadblob?container=" +
|
containerName,
|
||||||
containerName +
|
casefolderID,
|
||||||
"&casefolderID=" +
|
blobname: blob.name
|
||||||
encodeURIComponent(casefolderID) +
|
}),
|
||||||
"&blobname=" +
|
|
||||||
encodeURIComponent(blob.name),
|
|
||||||
...buildHashMetadataPaths({
|
...buildHashMetadataPaths({
|
||||||
containerName,
|
containerName,
|
||||||
casefolderID,
|
casefolderID,
|
||||||
blobname: fileName
|
blobname: fileName
|
||||||
}),
|
}),
|
||||||
"deletepath":
|
"deletepath": buildDeleteBlobQueryPath({
|
||||||
"/api/file/deleteblob?container=" +
|
containerName,
|
||||||
containerName +
|
casefolderID,
|
||||||
"&casefolderID=" +
|
blobname: fileName
|
||||||
encodeURIComponent(casefolderID) +
|
})
|
||||||
"&blobname=" +
|
|
||||||
encodeURIComponent(fileName)
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//console.log("blobObj:", blobObj);
|
//console.log("blobObj:", blobObj);
|
||||||
@@ -1487,25 +1483,23 @@ export const getRepsFilesBlobs = async (
|
|||||||
"isCurrentVersion": blob.isCurrentVersion,
|
"isCurrentVersion": blob.isCurrentVersion,
|
||||||
"contentLength": blob.properties.contentLength,
|
"contentLength": blob.properties.contentLength,
|
||||||
"filenameprefix": filenamePrefix,
|
"filenameprefix": filenamePrefix,
|
||||||
"filepath":
|
"filepath": buildDownloadBlobQueryPath({
|
||||||
"/api/file/downloadblob?container=" +
|
containerName,
|
||||||
containerName +
|
casefolderID: casefolderPath,
|
||||||
"&casefolderID=" +
|
blobname: repFileName
|
||||||
encodeURIComponent(casefolderPath) +
|
}),
|
||||||
"&blobname=" +
|
|
||||||
encodeURIComponent(repFileName),
|
|
||||||
...buildHashMetadataPaths({
|
...buildHashMetadataPaths({
|
||||||
containerName,
|
containerName,
|
||||||
casefolderID: casefolderPath,
|
casefolderID: casefolderPath,
|
||||||
blobname: repFileName
|
blobname: repFileName
|
||||||
}),
|
}),
|
||||||
"deletepath":
|
"deletepath": buildDeleteBlobQueryPath({
|
||||||
"/api/file/deleteblob?container=" +
|
containerName,
|
||||||
containerName +
|
casefolderID: casefolderPath,
|
||||||
"&casefolderID=" +
|
blobname: repFileName,
|
||||||
casefolderPath +
|
encodeCasefolderID: false,
|
||||||
"&blobname=" +
|
encodeBlobname: false
|
||||||
repFileName
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
consoleLogger("blobObj:", blobObj);
|
consoleLogger("blobObj:", blobObj);
|
||||||
|
|||||||
@@ -3100,3 +3100,35 @@ Validation:
|
|||||||
Follow-ups:
|
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.
|
- 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