This is my class.
export MyClass {
private readonly ServiceEndpoint: string =
"/xxx/xxx.DMS.UI.Root/Services/ConfigurationAPI.svc/";
public async GetAllCompanies(): Promise<CompanyDto[]> {
return fetchAsync(
`${this.ServiceEndpoint}Company`,
'GET'
)
.then(value => value.GetAllCompaniesResult);
}
}
Presently, this method returns a Promise <CompanyDto[]>. How do I rewrite it so that it returns only the result CompanyDto[]?