return badRequest();
}
try {
Dashboard dashboard = dashboardService.get(dashboardId);
DashboardWidget widget = dashboard.getWidget(widgetId);
widget.updateCacheTime(api(), newCacheTime);
return ok().as(Http.MimeTypes.JSON);
} catch (APIException e) {
String message = "Could not get widget. We expected HTTP 200, but got a HTTP " + e.getHttpCode() + ".";
return status(504, views.html.errors.error.render(message, e, request()));