-1
Good afternoon, everyone!
I have a class called Inventory that has the following attributes:
import InventoryItem from "./InventoryItem";
import InventoryConfiguration from "./InventoryConfiguration";
export default class Inventory {
id: string;
inventoryStatus: InventoryStatus;
inventoryConfiguration: InventoryConfiguration;
creationDate: Date;
inventoryItems: InventoryItem[];
inventoryReadedItems: InventoryItem[];
}
And in my API service, I get a get like this:
async getInventory(id: string): Promise<Inventory> {
this.store.select(a => a.user.token).subscribe(a => (this.userToken = a));
return this.http
.get<Inventory>(this.baseUrl + `/Inventories/${id}`, {
headers: {
Authorization: `Bearer ${this.userToken.access_token}`
}
})
.toPromise();
}
However, when using the service to check if returned a value in the Id, my method getInventory
that should return exactly the same as the class, because I typed.
But it’s back in the field id
as Id
(I capital).. So, when I go to do the if below, it falls into LSE because of this, they can help me to solve this problem?