This commit is contained in:
Peter Maquiran
2023-01-24 15:56:47 +01:00
parent 0748612054
commit fbd50137f3
153 changed files with 5997 additions and 953 deletions
+41 -1
View File
@@ -8,6 +8,7 @@ import { LoginUserRespose } from '../models/user.model';
import { EventSearch } from "src/app/models/event-search";
import { TopSearch } from 'src/app/models/top-search';
import { SessionStore } from '../store/session.service';
import { ChangeProfileService } from './change-profile.service';
@Injectable({
providedIn: 'root'
@@ -21,7 +22,20 @@ export class SearchService {
categories= Array;
// setup
constructor(private http: HttpClient, user: AuthService) {
constructor(
private http: HttpClient,
user: AuthService,
private changeProfileService: ChangeProfileService) {
this.setHeader();
this.changeProfileService.registerCallback(() => {
this.setHeader()
})
}
setHeader() {
this.loggeduser = SessionStore.user;
this.headers = new HttpHeaders();
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
@@ -52,6 +66,32 @@ export class SearchService {
return this.http.get<EventSearch>(`${geturl}`, options);
}
basicSearchPublication(subject:string, date:string = null, sender:string = null, organicEntity:string = null, docTypeId:string = null, applicationType:string): Observable<EventSearch>{
// Endpoint
const geturl = environment.apiURL + 'search';
// store params
let params = new HttpParams();
// set https params
params = params.set("assunto", subject);
params = params.set("data", date);
params = params.set("remetente", sender);
params = params.set("entidadeOrganica", organicEntity);
params = params.set("docTypeId", docTypeId);
params = params.set("applicationType", applicationType);
params = params.set("listOnlyFolders", true)
const options = {
headers: this.headers,
params: params
};
return this.http.get<EventSearch>(`${geturl}`, options);
}
mostSeachWord(size:string):Observable<any>{
// Endpoint