I have the next piece of code:
public async insert(data: iFlower | iFlower[]): Promise<iFlower> | Promise<iFlower[]> {
await this.insert(data);
}
private async insert(data: iFlower): Promise<iFlower>{
....
return data;
}
private async insert(data: iFlower[]): Promise<iFlower[]> {
....
return data;
}
iFlower is:
export interface iFlower {
color: string;
number: string;
}
I get the following errors:
The return type of an async function or method must be the global Promise<T> type.
Duplicate function implementation.
'insert' is declared but its value is never read.
Is it because iFlower is an interface?