Coding task · NestJS course · Module 1: NestJS Basics

DELETE Endpoint - Removing Resources

Write a DELETE endpoint for removing a legionary by ID.

Task

In a LegionController with the @Controller('legionaries') decorator and an array of legionaries, write a remove method with @Delete(':id') and @HttpCode(HttpStatus.NO_CONTENT) that reads the id through @Param('id') and removes the legionary with that id from the array. The method returns nothing.