-
-
Save kasramp/9fd8b685622c9a36754192ae84240bd1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
router.delete("/v1/users/:id", (context) => { | |
if (context.params && context.params.id && !isNaN(parseInt(context.params.id))) { | |
dummyUsers.splice(context.params.id - 1, 1); | |
context.response.status = 204; | |
} else { | |
context.response.status = 400; | |
context.response.body = { error: "Id must be number" }; | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment