first commit
This commit is contained in:
13
api/src/utils/http.ts
Normal file
13
api/src/utils/http.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { Proof } from '../entities/Proof.js';
|
||||
export const buildProofUrl = (storedName: string | null) => storedName ? `/uploads/${storedName}` : null;
|
||||
export const serializeProof = (proof: Proof) => ({
|
||||
id: proof.id,
|
||||
type: proof.type,
|
||||
label: proof.label,
|
||||
note: proof.note,
|
||||
originalName: proof.originalName,
|
||||
mimeType: proof.mimeType,
|
||||
fileSize: proof.fileSize,
|
||||
fileUrl: buildProofUrl(proof.storedName),
|
||||
createdAt: proof.createdAt
|
||||
});
|
||||
Reference in New Issue
Block a user