Title, Provider, tags from paperless

This commit is contained in:
MDeeApp
2025-10-11 11:32:04 +02:00
parent 8eb060f380
commit 342a73ecb5
11 changed files with 530 additions and 36 deletions

View File

@@ -365,6 +365,27 @@ app.get("/integrations/paperless/search", async (req, res, next) => {
}
});
app.get("/integrations/paperless/documents/:documentId", async (req, res, next) => {
if (!paperlessClient.isConfigured) {
return res.status(503).json({ error: "Paperless integration not configured" });
}
const documentId = parseId(req.params.documentId);
if (!documentId) {
return res.status(400).json({ error: "Invalid document id" });
}
try {
const document = await paperlessClient.getDocument(documentId);
if (!document) {
return res.status(404).json({ error: "Document not found" });
}
res.json(document);
} catch (error) {
next(error);
}
});
app.get("/contracts", (req, res) => {
const skip = Number(req.query.skip ?? 0);
const limit = Math.min(Number(req.query.limit ?? 100), 500);