attachments
This commit is contained in:
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user