mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
merge
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user