mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	client support for selection data
This commit is contained in:
		| @@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'; | ||||
| import { PaperlessDocument } from 'src/app/data/paperless-document'; | ||||
| import { PaperlessDocumentMetadata } from 'src/app/data/paperless-document-metadata'; | ||||
| import { AbstractPaperlessService } from './abstract-paperless-service'; | ||||
| import { HttpClient } from '@angular/common/http'; | ||||
| import { HttpClient, HttpParams } from '@angular/common/http'; | ||||
| import { Observable } from 'rxjs'; | ||||
| import { Results } from 'src/app/data/results'; | ||||
| import { FilterRule } from 'src/app/data/filter-rule'; | ||||
| @@ -22,6 +22,17 @@ export const DOCUMENT_SORT_FIELDS = [ | ||||
|   { field: 'modified', name: $localize`Modified` } | ||||
| ] | ||||
|  | ||||
| export interface SelectionDataItem { | ||||
|   id: number | ||||
|   document_count: number | ||||
| } | ||||
|  | ||||
| export interface SelectionData { | ||||
|   correspondents: SelectionDataItem[] | ||||
|   tags: SelectionDataItem[] | ||||
|   document_types: SelectionDataItem[] | ||||
| } | ||||
|  | ||||
| @Injectable({ | ||||
|   providedIn: 'root' | ||||
| }) | ||||
| @@ -114,4 +125,9 @@ export class DocumentService extends AbstractPaperlessService<PaperlessDocument> | ||||
|     }) | ||||
|   } | ||||
|  | ||||
|   selectionData(ids: number[]): Observable<SelectionData> { | ||||
|     console.log(ids) | ||||
|     return this.http.post<SelectionData>(this.getResourceUrl(null, 'selection_data'), {"documents": ids}) | ||||
|   } | ||||
|  | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 jonaswinkler
					jonaswinkler