This commit is contained in:
Mateusz Gruszczyński
2026-04-07 10:06:48 +02:00
parent deaa6dfe43
commit ca9c78d88d
36 changed files with 1801 additions and 503 deletions

View File

@@ -1,6 +1,6 @@
import type { Proof } from '../entities/Proof.js';
export const buildProofUrl = (storedName: string | null) => storedName ? `/uploads/${storedName}` : null;
export const serializeProof = (proof: Proof) => ({
export const serializeProof = (proof: Proof, _expenseId?: string) => ({
id: proof.id,
type: proof.type,
label: proof.label,
@@ -9,5 +9,6 @@ export const serializeProof = (proof: Proof) => ({
mimeType: proof.mimeType,
fileSize: proof.fileSize,
fileUrl: buildProofUrl(proof.storedName),
previewUrl: buildProofUrl(proof.storedName),
createdAt: proof.createdAt
});