Have an api method that returns a simple string. I am implementing a method in my angular service that needs to return an obserable
The simple string doesnt map directly into the observable. How can I return an observable with the simple string result from the api?
public setLineItemListApproval(lines : OrderLinesModel) : Observable<string>{
let actionUrl = this.apiBaseURL + '/mycontroller/actionmethod1';
const httpOptions = {
headers: new HttpHeaders({
'Content-Type': 'application/json'
})
};
return this.httpClient.post<string>(actionUrl, lines, httpOptions).pipe(catchError(this.handleError));
}