diff --git a/src/app/app.html b/src/app/app.html
index 24ff786..39d30e9 100644
--- a/src/app/app.html
+++ b/src/app/app.html
@@ -1,7 +1,6 @@
-
diff --git a/src/app/interfaces/user.ts b/src/app/interfaces/user.ts
index 49bd4e9..1cbdb2a 100644
--- a/src/app/interfaces/user.ts
+++ b/src/app/interfaces/user.ts
@@ -1,14 +1,16 @@
export interface User {
email: string,
password: string,
- roles: string[]
+ roles: string[],
+ favorites: string[],
}
export interface LoggedUser {
email: string,
token: string,
- roles: string[]
+ roles: string[],
+ favorites: string[],
}
export interface UserToRegister {
@@ -19,4 +21,5 @@ export interface UserToRegister {
cityCode: string,
city: string,
phone: string,
+ favorites: string[],
}
diff --git a/src/app/pages/login/login.ts b/src/app/pages/login/login.ts
index 5bcb797..068d027 100644
--- a/src/app/pages/login/login.ts
+++ b/src/app/pages/login/login.ts
@@ -24,7 +24,7 @@ export class Login {
}
async login() {
- const userToConnect : User = {email: this.email(), password: this.password(),roles: []}
+ const userToConnect : User = {email: this.email(), password: this.password(),roles: [], favorites: []}
try{
const loginSuccess =await firstValueFrom(this.userService.login(userToConnect));
if(loginSuccess){
diff --git a/src/app/services/auth.ts b/src/app/services/auth.ts
index 51da743..1af20df 100644
--- a/src/app/services/auth.ts
+++ b/src/app/services/auth.ts
@@ -50,7 +50,8 @@ export class Auth {
passwordConfirm: user.passwordConfirm,
cityCode: user.cityCode,
city: user.city,
- phone: user.phone };
+ phone: user.phone,
+ favorites: user.favorites };
const headers = new HttpHeaders({ 'Content-Type': 'application/json' });
return this.http.post>(apiUrl, requestBody, { headers }).pipe(
@@ -88,7 +89,8 @@ export class Auth {
const userStoreData: LoggedUser = {
email: res.data.email,
token: res.data.token,
- roles: res.data.roles || []
+ roles: res.data.roles || [],
+ favorites: res.data.roles || []
};
sessionStorage.setItem('connectedUser', JSON.stringify(userStoreData));
this.connectedUserSignal.set(userStoreData);
diff --git a/src/app/shared/sidebar/sidebar.ts b/src/app/shared/sidebar/sidebar.ts
index 066d597..80c8ff9 100644
--- a/src/app/shared/sidebar/sidebar.ts
+++ b/src/app/shared/sidebar/sidebar.ts
@@ -4,7 +4,7 @@ import { Auth } from '../../services/auth';
@Component({
selector: 'app-sidebar',
- imports: [],
+ imports: [RouterLink],
templateUrl: './sidebar.html',
styleUrl: './sidebar.css'
})
@@ -13,9 +13,7 @@ export class Sidebar {
isLoggedIn = computed(()=>this.userEmail() !== null)
currentUserEmail = computed(()=> this.userEmail());
-
constructor(private readonly loginservice: Auth, private readonly router: Router){
-
}
logout(){