@arolariu/website / lib/actions/scans/deleteScan / deleteScan
Function: deleteScan()
deleteScan(
input):DeleteScanOutput
Defined in: lib/actions/scans/deleteScan.ts:73
Deletes a scan from Azure Blob Storage.
Parameters
input
DeleteScanInput
Delete parameters
Returns
DeleteScanOutput
Object with success status and optional error message
Remarks
Execution Context: Server-side only (Next.js server action).
Authentication: Automatically fetches user from auth service.
Authorization:
The blob path must contain the user identifier, ensuring users can only
delete their own scans. Format: scans/{userIdentifier}/...
Idempotency: If the blob doesn't exist, the operation returns success (no error).
Side Effects: Emits OpenTelemetry spans for tracing.
Example
const {success, error} = await deleteScan({
blobUrl: "https://storage.../scans/user_abc123/scan-001.jpg"
});
if (success) {
scansStore.removeScan(scanId);
} else {
toast.error(error);
}