I am attempting to define a function in typescript using generics, but I encountered the following error:
"Property 'id' does not exist on type 'CustomerInterface'" This occurs at: customer.id === +id
getCustomer<CustomerInterface>(id: number | string){
return this.getCustomers<CustomerInterface>('')
.then(customers => customers.find(customer => customer.id === +id));
}
The interface is outlined as follows:
export interface CustomerInterface {
id: number
name: string
display_name: string
address: string
city: string
phone_number: string
}