Angular Put request throwing a parsing error

Viewed 24

Angular put request throws an error while updating the values in db. Backend returns the success message but angular throws an error

activeStatus(activeStatusDto: ActiveStatusDto) {
return this.http.put<ActiveStatusDto>(
  `${BASE_URL}/users/status`,
  activeStatusDto
)
}

this.dataService
  .activeStatus(activeStatusDto)
  .pipe(
    map((res: any) => {
     
      this.refreshUsers();
      return res;
    }),
    catchError((error: Error) => {
      
      return throwError(() => new Error(error.message));
    }),
    take(1)
  )
  

Since backend returns the success message I assume there is no problem in backend. Even my value get updated but I want to refresh the data after updating the value. I'm not sure whats going wrong here?

0 Answers
Related