remove label api

This commit is contained in:
Ezequiel Bergamaschi
2014-01-30 04:35:48 -03:00
committed by Ezequiel Bergamaschi
parent c8e0b92ef5
commit b79930394d
5 changed files with 31 additions and 0 deletions

View File

@@ -93,4 +93,16 @@ public class LabelController extends BaseController {
mindmapService.updateMindmap(mindmap, false);
}
}
@RequestMapping(method = RequestMethod.DELETE, value = "/labels/{id}")
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void deleteMapById(@PathVariable int id) throws WiseMappingException {
final User user = Utils.getUser();
final Label label = labelService.getLabelById(id);
if (label == null) {
throw new LabelCouldNotFoundException("Label could not be found. Id: " + id);
}
assert user != null;
labelService.removeLabel(label, user);
}
}