Improve search page

This commit is contained in:
2021-02-08 12:27:45 +01:00
parent 3e09cb0b66
commit 8dedc4eb94
9 changed files with 1289 additions and 12 deletions
+20 -1
View File
@@ -1,11 +1,12 @@
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Event } from '../models/event.model';
import { Observable } from 'rxjs';
import { from, Observable } from 'rxjs';
import { environment } from 'src/environments/environment';
import { AuthService } from '../services/auth.service';
import { User } from '../models/user.model';
import { EventSearch } from "src/app/models/event-search";
import { TopSearch } from 'src/app/models/top-search';
@Injectable({
providedIn: 'root'
@@ -52,4 +53,22 @@ export class SearchService {
return this.http.get<EventSearch>(`${geturl}`, options);
}
mostSeachWord(size:string): Observable<TopSearch>{
// Endpoint
const geturl = environment.apiURL + 'search/top';
// store params
let params = new HttpParams();
// set https params
params = params.set("size", size);
const options = {
headers: this.headers,
params: params
};
return this.http.get<TopSearch>(`${geturl}`, options);
}
}