use of com.liferay.apio.architect.routes.ItemRoutes in project com-liferay-apio-architect by liferay.
the class PageEndpointImpl method deleteCollectionItem.
@Override
public Response deleteCollectionItem(String id) throws Exception {
Try<ItemRoutes<T, S>> itemRoutesTry = Try.fromOptional(_itemRoutesSupplier::get, notFound(_name));
ThrowableConsumer<S> throwableConsumer = itemRoutesTry.mapOptional(ItemRoutes::getDeleteConsumerOptional, notAllowed(DELETE, _name, id)).map(function -> function.apply(_httpServletRequest)).getUnchecked();
Path path = new Path(_name, id);
throwableConsumer.accept(_identifierFunction.apply(path));
return noContent().build();
}
Aggregations