Skip to content

Instantly share code, notes, and snippets.

@chathurawidanage
Created September 3, 2016 08:19
Show Gist options
  • Save chathurawidanage/aaf3de2da7b507867da84a48f33f8e91 to your computer and use it in GitHub Desktop.
Save chathurawidanage/aaf3de2da7b507867da84a48f33f8e91 to your computer and use it in GitHub Desktop.
@RequestMapping( value = "/{id}", method = RequestMethod.DELETE )
@PreAuthorize( "hasRole('ALL') or hasRole('F_TRACKED_ENTITY_INSTANCE_ADD')" )
@ResponseStatus( HttpStatus.NO_CONTENT )
public void deleteTrackedEntityInstance( @PathVariable String id ) throws WebMessageException
{
if ( !instanceService.trackedEntityInstanceExists( id ) )
{
throw new WebMessageException( WebMessageUtils.notFound( "Tracked entity instance not found for ID " + id ) );
}
trackedEntityInstanceService.deleteTrackedEntityInstance( id );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment