mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
added autocomplete
This commit is contained in:
@@ -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)})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user