attachments

This commit is contained in:
2026-05-07 11:04:24 -05:00
parent 5b3da47d87
commit 82bc055c4c
4 changed files with 331 additions and 6 deletions

View File

@@ -168,6 +168,20 @@ const API = {
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data)
}).then(r => r.json()),
attachToExpense: (expenseId, file, note) => {
const fd = new FormData();
fd.append('file', file);
if (note) fd.append('note', note);
return fetch(`/api/accounting/expenses/${expenseId}/attach`, {
method: 'POST',
body: fd
// KEIN Content-Type-Header setzen — Browser fügt boundary auto ein!
}).then(r => r.json());
},
getAttachmentLimits: () =>
fetch('/api/accounting/attachments/limits').then(r => r.json()),
listExpenses: (startDate, endDate, onlyMine = false) => {
const params = new URLSearchParams({ startDate, endDate });