Created
April 18, 2019 16:16
-
-
Save recursivecodes/0a0009189b63325ba1e07720ca15427d 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
@Delete("/delete/{id}") | |
HttpResponse<Map> deletePerson(Long id) { | |
try { | |
return HttpResponse.ok( [person: personService.delete(id), deleted: true] as Map ) | |
} | |
catch(e) { | |
return HttpResponse.unprocessableEntity().body( | |
[ | |
message: "Could not delete person with ID: ${id}" | |
] | |
) as HttpResponse<Map> | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment