Can anyone provide insights on the error message "Not all code paths return the value" that I'm encountering?
Additionally, is there a more efficient way to utilize ES6 features instead of using forEach loops?
main.ts
if (rxInfos.length && rxInfos !== undefined) {
rxInfos.forEach((rxInfo: any) => {
// const requestArray: IRequestURL[] = [];
for (const member of specialtyMembers) {
if (member.indexID === rxInfo.indexID) {
proxyMember = member;
if (!member.dateOfBirth) {
statusDesc = "member dateOfbirth not found";
return Promise.reject(this.errorHandler(request, statusDesc));
}
const body: any = this.buildSingleRequestBody(proxyMember, rxInfo);
const requestObject = this.specialtyQuestionRequest(body);
this.requestArray.push(requestObject);
break;
}
}
});
}