paperless-ngx/src-ui/src/app/services/rest/search.service.ts

20 lines
601 B
TypeScript
Raw Normal View History

2020-10-27 01:10:18 +01:00
import { HttpClient, HttpParams } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
2020-12-04 01:26:27 +01:00
import { map } from 'rxjs/operators';
2020-10-27 01:10:18 +01:00
import { environment } from 'src/environments/environment';
2020-12-04 01:26:27 +01:00
import { DocumentService } from './document.service';
2020-10-27 01:10:18 +01:00
@Injectable({
providedIn: 'root'
})
export class SearchService {
constructor(private http: HttpClient) { }
2020-10-27 17:05:14 +01:00
autocomplete(term: string): Observable<string[]> {
return this.http.get<string[]>(`${environment.apiBaseUrl}search/autocomplete/`, {params: new HttpParams().set('term', term)})
}
2020-10-27 01:10:18 +01:00
}