Answer the question
In order to leave comments, you need to log in
Why is the delete method not working?
Good afternoon, I'm trying to parse in the backend and I can't understand why the deletion method does not work
In the service:
async remove(req) {
return await this.UserRepository.destroy({
where : {id : req.param.id},
force : true
});
}
@Delete(':id')
remove(@Param('id') id : string)
{
return this.usersService.remove(id);
}
Answer the question
In order to leave comments, you need to log in
Maybe the service should be like this?
async remove(userId: number) {
return await this.UserRepository.destroy({
where : {id : userId},
force : true
});
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question