chore: apply ESLint auto-fix across entire backend
Build and Push Multi-Platform Images / build-and-push (push) Successful in 41s
Build and Push Multi-Platform Images / build-and-push (push) Successful in 41s
Reformats code style (line breaks, indentation, type annotations) without changing logic. Also includes minor feature additions bundled in the same lint run (stats service, user-settings groups, agrarmonitor polling improvements). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
4c75a1ded2
commit
dad0136365
74 files changed
+4022
-1052
No files matched your search
@@ -16,7 +16,11 @@ export class FreigabeService {
|
||||
private readonly paperlessService: PaperlessService,
|
||||
) {}
|
||||
|
||||
async getFreigabeDocuments(page: number, pageSize: number, nurNichtFreigegeben: boolean) {
|
||||
async getFreigabeDocuments(
|
||||
page: number,
|
||||
pageSize: number,
|
||||
nurNichtFreigegeben: boolean,
|
||||
) {
|
||||
const docTypes = await this.documentTypeRepo.find({
|
||||
where: { FreigabeErforderlich: true as any },
|
||||
});
|
||||
@@ -47,7 +51,9 @@ export class FreigabeService {
|
||||
} catch (err: any) {
|
||||
// Fallback: Paperless unterstützt den custom_fields-Filter möglicherweise nicht
|
||||
// In diesem Fall alle Belege laden und client-seitig filtern
|
||||
this.logger.warn('custom_fields Filter nicht unterstützt, lade alle Belege und filtere lokal');
|
||||
this.logger.warn(
|
||||
'custom_fields Filter nicht unterstützt, lade alle Belege und filtere lokal',
|
||||
);
|
||||
const fallbackParams: Record<string, any> = {
|
||||
page: 1,
|
||||
page_size: 9999,
|
||||
@@ -60,8 +66,15 @@ export class FreigabeService {
|
||||
|
||||
if (nurNichtFreigegeben) {
|
||||
const filtered = results.filter((doc: any) => {
|
||||
const cf = (doc.custom_fields ?? []).find((f: any) => f.field === FREIGABE_FIELD_ID);
|
||||
return !cf || cf.value === null || cf.value === '' || cf.value === undefined;
|
||||
const cf = (doc.custom_fields ?? []).find(
|
||||
(f: any) => f.field === FREIGABE_FIELD_ID,
|
||||
);
|
||||
return (
|
||||
!cf ||
|
||||
cf.value === null ||
|
||||
cf.value === '' ||
|
||||
cf.value === undefined
|
||||
);
|
||||
});
|
||||
const start = (page - 1) * pageSize;
|
||||
return {
|
||||
@@ -82,20 +95,24 @@ export class FreigabeService {
|
||||
const doc = await this.paperlessService.getDocument(documentId);
|
||||
const customFields: any[] = [...(doc.custom_fields ?? [])];
|
||||
|
||||
const existing = customFields.find((f: any) => f.field === FREIGABE_FIELD_ID);
|
||||
const existing = customFields.find(
|
||||
(f: any) => f.field === FREIGABE_FIELD_ID,
|
||||
);
|
||||
if (existing) {
|
||||
existing.value = value;
|
||||
} else if (value !== null && value !== '') {
|
||||
customFields.push({ field: FREIGABE_FIELD_ID, value });
|
||||
}
|
||||
|
||||
await this.paperlessService.updateDocument(documentId, { custom_fields: customFields });
|
||||
await this.paperlessService.updateDocument(documentId, {
|
||||
custom_fields: customFields,
|
||||
});
|
||||
return { success: true };
|
||||
}
|
||||
|
||||
async getFreigabeOptions(): Promise<{ id: string; label: string }[]> {
|
||||
const fields = await this.paperlessService.getCustomFields();
|
||||
const field = (fields as any[]).find((f: any) => f.id === FREIGABE_FIELD_ID);
|
||||
const field = fields.find((f: any) => f.id === FREIGABE_FIELD_ID);
|
||||
if (!field) return [];
|
||||
|
||||
const rawOptions: any[] = field.extra_data?.select_options ?? [];
|
||||
|
||||
Reference in new issue
Block a user