At first, the user collection is represented by Model:1
{
"_id":"sodjflkadkjj2342",
"role:["customer"],
"active":true,
"email":"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="15767d677c66557477763b767a78">[email protected]</a>",
"password":"$2a$10$RsemeECS8vCEav/CPgO75ucr5C2e3ybplnMShchlDKn6naUcEI0uW",
"pwd_token":1502,
"phone":1234567890
}
It has been updated and now referred to as Model 1.1
{
"_id":"sodjflkadkjj2342",
"role:["customer","employee"],
"active":true,
"email":"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="17747f657e64577675743974787a">[email protected]</a>",
"password":"$2a$10$RsemeECS8vCEav/CPgO75ucr5C2e3ybplnMShchlDKn6naUcEI0uW",
"pwd_token":1502,
"phone":1234567890
}
The details can be retrieved via Postman using an API, but only Model 1 is returned as a response from the client
Client
getUserDetails(token): Observable<any> {
return this.http.get(environment.apiBase+'/api/user/get',{
headers: {
Authotization: token
}
});
};
TS
getUsers() {
this.userService.getUserDetails(this.token).subscribe(
data =>{this.users = data,
console.log(this.users);
},
error => console.log(error),
);
}