My service requires an id parameter for a route, but when I tried to access the route with the id, I encountered the error mentioned above. Any suggestions on how to resolve this issue?
https://i.sstatic.net/FEcqo.png
#request
const apiBaseUrl = `${environment.apiUrl}/api/userprofile`;
deactivateUserProfileStatus(id: number) {
return this.httpRequestService.put(`${apiBaseUrl}/inactive/${id}`);
}
#typescript
DeactivateUserProfileStatus(id: number) {
this.isInProgress = true;
this._userService
.deactivateUserProfileStatus(id)
.pipe(
finalize(() => {
this.isInProgress = false;
})
)
.subscribe({
next: (res) => {
this._notificationService.showSuccess(
'User status has been updated successfully.'
);
// this.generalForm.disable();
this.getUserGeneralDetails();
// this._router.navigate(['transactions']);
},
error: (err) => {
this._notificationService.showError(
'Something went wrong, Try again later.'
);
this.isInProgress = false;
},
complete: () => {
this.isInProgress = false;
},
});
}
}