mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Feature: Implement custom fields for documents (#4502)
Adds custom fields of certain data types, attachable to documents and searchable Co-Authored-By: Trenton H <797416+stumpylog@users.noreply.github.com>
This commit is contained in:
14
src-ui/src/app/services/rest/custom-fields.service.spec.ts
Normal file
14
src-ui/src/app/services/rest/custom-fields.service.spec.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { HttpTestingController } from '@angular/common/http/testing'
|
||||
import { Subscription } from 'rxjs'
|
||||
import { TestBed } from '@angular/core/testing'
|
||||
import { environment } from 'src/environments/environment'
|
||||
import { commonAbstractPaperlessServiceTests } from './abstract-paperless-service.spec'
|
||||
import { CustomFieldsService } from './custom-fields.service'
|
||||
|
||||
let httpTestingController: HttpTestingController
|
||||
let service: CustomFieldsService
|
||||
let subscription: Subscription
|
||||
const endpoint = 'custom_fields'
|
||||
|
||||
// run common tests
|
||||
commonAbstractPaperlessServiceTests(endpoint, CustomFieldsService)
|
15
src-ui/src/app/services/rest/custom-fields.service.ts
Normal file
15
src-ui/src/app/services/rest/custom-fields.service.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Injectable } from '@angular/core'
|
||||
import { HttpClient, HttpParams } from '@angular/common/http'
|
||||
import { AbstractPaperlessService } from './abstract-paperless-service'
|
||||
import { Observable } from 'rxjs'
|
||||
import { PaperlessCustomField } from 'src/app/data/paperless-custom-field'
|
||||
import { PaperlessCustomFieldInstance } from 'src/app/data/paperless-custom-field-instance'
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class CustomFieldsService extends AbstractPaperlessService<PaperlessCustomField> {
|
||||
constructor(http: HttpClient) {
|
||||
super(http, 'custom_fields')
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user