crud icon indicating copy to clipboard operation
crud copied to clipboard

Suggestion: Return "204 No Content" by default in DELETE actions

Open Char2sGu opened this issue 4 years ago • 4 comments

According to the REST specification, a 204 should be returned if a DELETE action is successfully performed, but now the lib returns a 200 instead.

Char2sGu avatar Apr 05 '21 02:04 Char2sGu

is there a way to change the response code though options or something?

SDToews avatar May 27 '22 15:05 SDToews

I'm handling this way:

import { Delete, HttpCode, HttpStatus } from '@nestjs/common';

@Delete(':id')
@HttpCode(HttpStatus.NO_CONTENT)
...

Would be nice if @Delete default was 204 with the option to override

minlare avatar Aug 01 '23 09:08 minlare