feat: add receipt upload functionality for Einnahmen and Beleg routes
Build and Push Docker Image / build (push) Successful in 1m34s
Build and Push Docker Image / build (push) Successful in 1m34s
- Implemented upload and retrieval of receipts (Belege) associated with Einnahmen entries. - Added new API routes for uploading and deleting receipts. - Updated the Einnahmen model to include a `belegUrl` field for storing receipt references. - Enhanced the Einnahmen page to support file uploads and display existing receipts. - Introduced drag-and-drop functionality for file uploads and improved user feedback during uploads. - Added necessary validation for file types and sizes during uploads.
This commit is contained in:
@@ -9,6 +9,7 @@ const updateSchema = z.object({
|
||||
zahlungsart: z.enum(["KASSE", "BANK"]).default("BANK"),
|
||||
datum: z.string().min(1),
|
||||
beschreibung: z.string().optional(),
|
||||
belegUrl: z.string().optional(),
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -48,6 +49,7 @@ export async function action({ request, params }: { request: Request; params: {
|
||||
account: parsed.data.zahlungsart === "KASSE" ? "KASSE" : "BANK",
|
||||
date: new Date(parsed.data.datum),
|
||||
description: parsed.data.beschreibung,
|
||||
belegUrl: parsed.data.belegUrl || null,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user