Merge branch 'feature/calendar' into developer

This commit is contained in:
tiago.kayaya
2021-03-31 17:02:42 +01:00
4 changed files with 16 additions and 14 deletions
+2 -1
View File
@@ -2,5 +2,6 @@ export class User {
username: string;
password: string;
domainName: string;
BasicAuthKey: string
BasicAuthKey: string;
UserId?: number;
}
+6 -6
View File
@@ -35,9 +35,7 @@ export class AuthService {
async login(user: User): Promise<boolean> {
user.BasicAuthKey = 'Basic ' + btoa(user.username + '@' + user.domainName + ':' + user.password); //conversão em base64 das credenciais inseridas
//if(!environment.production){
localStorage.setItem('user', JSON.stringify(user) );
//}
const options = { headers: {'Authorization': user.BasicAuthKey }};
this.headers = this.headers.set('Authorization',user.BasicAuthKey);
@@ -52,12 +50,14 @@ export class AuthService {
result = await this.http.get<boolean>(service, options).toPromise();
response = await this.http.post<any>(environment.apiURL + "UserAuthentication/Login", '', this.opts).toPromise();
console.log(response);
if (result)
{
this.ValidatedUser = user;
//if(!environment.production){
localStorage.setItem('user', JSON.stringify(Object.assign(user, response) ) );
//}
this.storageService.store(AuthConnstants.USER, response);
}
return result;
+6 -5
View File
@@ -17,8 +17,6 @@ export class SearchService {
loggeduser: User;
headers: HttpHeaders;
categories= Array;
// setup
@@ -55,15 +53,18 @@ export class SearchService {
mostSeachWord(size:string):Observable<any>{
// Endpoint
const geturl = environment.apiURL + 'search/top';
let UserId = (this.loggeduser.UserId).toString();
const geturl = environment.apiURL + 'Processes/GetHitsByUserId';
// store params
let params = new HttpParams();
// set https params
params = params.set("userId", UserId);
params = params.set("size", size);
const options = {
const options = {
headers: this.headers,
params: params
};
@@ -13,7 +13,7 @@
<ion-content>
<div class="main-content">
<div class="ion-item-container">
<ion-input placeholder="Assunto" [(ngModel)]="postEvent.Subject"></ion-input>
<ion-input type="text" placeholder="Assunto" [(ngModel)]="postEvent.Subject"></ion-input>
</div>
<div class="container-div">
<div class="ion-item-class-2 d-flex">
@@ -21,7 +21,7 @@
<ion-icon slot="start" src="assets/images/icons-location.svg"></ion-icon>
</div>
<div class="ion-input-class flex-grow-1">
<ion-input placeholder="Localização" [(ngModel)]="postEvent.Location"></ion-input>
<ion-input type="text" placeholder="Localização" [(ngModel)]="postEvent.Location"></ion-input>
</div>
</div>
<!-- Error messages -->