Skip to content

Instantly share code, notes, and snippets.

@recursivecodes
Created April 18, 2019 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save recursivecodes/0a0009189b63325ba1e07720ca15427d to your computer and use it in GitHub Desktop.
Save recursivecodes/0a0009189b63325ba1e07720ca15427d to your computer and use it in GitHub Desktop.
@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