mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-11-26 16:25:06 -05:00
21 lines
610 B
TypeScript
21 lines
610 B
TypeScript
import { HttpClient, HttpParams } from '@angular/common/http'
|
|
import { Injectable } from '@angular/core'
|
|
import { Observable } from 'rxjs'
|
|
import { map } from 'rxjs/operators'
|
|
import { environment } from 'src/environments/environment'
|
|
import { DocumentService } from './document.service'
|
|
|
|
@Injectable({
|
|
providedIn: 'root',
|
|
})
|
|
export class SearchService {
|
|
constructor(private http: HttpClient) {}
|
|
|
|
autocomplete(term: string): Observable<string[]> {
|
|
return this.http.get<string[]>(
|
|
`${environment.apiBaseUrl}search/autocomplete/`,
|
|
{ params: new HttpParams().set('term', term) }
|
|
)
|
|
}
|
|
}
|