I am getting an error when adding an if else condition inside the async function in Angular. I need to have a return to avoid the error in my async function
asyncFunction: (value) => {
if (value.includes('SAMPLESTRING')) {
const getApplication = this.myService.getApplication({ id: value })
.pipe(map(({ Application }) => Application))
} else {
const getApplication = this.myService.getApplication({ name: value })
.pipe(map(({ Applications }) => Applications))
}
return getApplication;
}