Revize 4837b991
Přidáno uživatelem Ondřej Váně před téměř 5 roky(ů)
fe/fulltextsearch/src/app/model/Query.ts | ||
---|---|---|
1 |
export class Query { |
|
2 |
query: string; |
|
3 |
date: Date; |
|
4 |
|
|
5 |
constructor(query: string, date: Date) { |
|
6 |
this.query = query; |
|
7 |
this.date = date; |
|
8 |
} |
|
9 |
} |
fe/fulltextsearch/src/app/services/query.service.ts | ||
---|---|---|
1 | 1 |
import {Injectable} from '@angular/core'; |
2 |
import {HttpClient, HttpEventType, HttpHeaders} from '@angular/common/http';
|
|
2 |
import {HttpClient, HttpHeaders} from '@angular/common/http'; |
|
3 | 3 |
import {Observable} from 'rxjs'; |
4 |
import {Query} from '../model/Query'; |
|
5 | 4 |
import {DocumentResponse} from '../model/DocumentResponse'; |
6 | 5 |
import {SearchResponse} from '../model/SearchResponse'; |
6 |
import {SearchRequest} from '../model/SearchRequest'; |
|
7 | 7 |
|
8 | 8 |
const httpOptions = { |
9 | 9 |
headers: new HttpHeaders( { |
... | ... | |
22 | 22 |
|
23 | 23 |
constructor(private httpClient: HttpClient) {} |
24 | 24 |
|
25 |
searchPost(query: Query): Observable<SearchResponse> {
|
|
26 |
return this.httpClient.post<SearchResponse>(this.backendUrl, query, httpOptions);
|
|
25 |
searchPost(searchRequest: SearchRequest): Observable<SearchResponse> {
|
|
26 |
return this.httpClient.post<SearchResponse>(this.backendUrl, searchRequest, httpOptions);
|
|
27 | 27 |
} |
28 | 28 |
|
29 | 29 |
|
Také k dispozici: Unified diff
Re #7801: Přesměrování na search page s response
- oprava metody searchPost pro odesílání dotazu