in the nest.js app we can set @HttpCode() for response HTTP status code for method! now I want to change HTTP status code in if condition in the method body of the controller
for example:
@Get()
@HttpCode(200)
findAll() {
if(condition){
// Question is: How Can i return response with 409 HTTP status code
}
return this.response.success(
[
{ id: 12, first_name: 'test1' },
{ id: 13, first_name: 'test 2' },
],
'success',
);
}