mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-16 19:46:48 +01:00
added autocomplete
This commit is contained in:
parent
8b5470bc55
commit
fb0ad94a9c
5 changed files with 44 additions and 9 deletions
|
|
@ -14,9 +14,9 @@ export abstract class AbstractPaperlessService<T extends ObjectWithId> {
|
|||
let url = `${this.baseUrl}${this.resourceName}/`
|
||||
if (id) {
|
||||
url += `${id}/`
|
||||
if (action) {
|
||||
url += `${action}/`
|
||||
}
|
||||
}
|
||||
if (action) {
|
||||
url += `${action}/`
|
||||
}
|
||||
return url
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,4 +34,8 @@ export class SearchService {
|
|||
search(query: string): Observable<SearchResult[]> {
|
||||
return this.http.get<SearchResult[]>(`${environment.apiBaseUrl}search/`, {params: new HttpParams().set('query', query)})
|
||||
}
|
||||
|
||||
autocomplete(term: string): Observable<string[]> {
|
||||
return this.http.get<string[]>(`${environment.apiBaseUrl}search/autocomplete/`, {params: new HttpParams().set('term', term)})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue