Schließe die Connector-Kapselung ab, damit Paperless, IMAP und weitere Quellen über dieselbe Anbindung laufen.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
75a3949f7c
commit
d6b70d8f92
75 files changed
+9477
-414
No files matched your search
+6
-2
@@ -101,7 +101,7 @@ export async function downloadMailPart(elementId, context, suffix, filename) {
|
||||
setTimeout(() => URL.revokeObjectURL(url), 60000);
|
||||
}
|
||||
|
||||
export async function fetchPaperless(elementId, context) {
|
||||
export async function fetchExternal(elementId, context) {
|
||||
const params = new URLSearchParams();
|
||||
if (context?.kind && context?.id) {
|
||||
params.set("context_kind", context.kind);
|
||||
@@ -113,11 +113,15 @@ export async function fetchPaperless(elementId, context) {
|
||||
});
|
||||
if (!response.ok) {
|
||||
const data = await response.json().catch(() => null);
|
||||
throw new Error(data?.detail || "Das Paperless-Dokument ist nicht verfügbar.");
|
||||
throw new Error(data?.detail || "Die Quelle stellt die Datei nicht bereit.");
|
||||
}
|
||||
return response.blob();
|
||||
}
|
||||
|
||||
export async function fetchPaperless(elementId, context) {
|
||||
return fetchExternal(elementId, context);
|
||||
}
|
||||
|
||||
export async function fetchFile(elementId, context) {
|
||||
const params = new URLSearchParams();
|
||||
if (context?.kind && context?.id) {
|
||||
|
||||
Reference in new issue
Block a user