Skip to content
Snippets Groups Projects
Commit c7bf3d73 authored by Allen Gilliland's avatar Allen Gilliland
Browse files

fix error where our attempt to delete the data intensive fields from a...

fix error where our attempt to delete the data intensive fields from a Table/Field before making an api call wasn't happening.
parent 95922163
No related branches found
No related tags found
No related merge requests found
......@@ -94,10 +94,10 @@ function($scope, $route, $routeParams, $location, $q, $timeout, databases, Metab
$scope.updateTable = function(table) {
// make sure we don't send all the computed metadata
table = { ...table };
delete table.fields, table.fields_lookup, table.aggregation_options, table.breakout_options, table.metrics, table.segments;
let slimTable = { ...table };
slimTable = _.omit(slimTable, "fields", "fields_lookup", "aggregation_options", "breakout_options", "metrics", "segments");
return Metabase.table_update(table).$promise.then(function(result) {
return Metabase.table_update(slimTable).$promise.then(function(result) {
_.each(result, (value, key) => { if (key.charAt(0) !== "$") { table[key] = value } });
table.metadataStrength = computeMetadataStrength(table);
$timeout(() => $scope.$digest());
......@@ -106,10 +106,10 @@ function($scope, $route, $routeParams, $location, $q, $timeout, databases, Metab
$scope.updateField = function(field) {
// make sure we don't send all the computed metadata
field = { ...field };
delete field.operators_lookup, field.valid_operators, field.values;
let slimField = { ...field };
slimField = _.omit(slimField, "operators_lookup", "valid_operators", "values");
return Metabase.field_update(field).$promise.then(function(result) {
return Metabase.field_update(slimField).$promise.then(function(result) {
_.each(result, (value, key) => { if (key.charAt(0) !== "$") { field[key] = value } });
let table = _.findWhere($scope.databaseMetadata.tables, {id: field.table_id});
table.metadataStrength = computeMetadataStrength(table);
......
......@@ -10,7 +10,6 @@ import VisualizationSettings from './VisualizationSettings.jsx';
import Visualization from "metabase/visualizations/components/Visualization.jsx";
import MetabaseSettings from "metabase/lib/settings";
import Modal from "metabase/components/Modal.jsx";
import ModalWithTrigger from "metabase/components/ModalWithTrigger.jsx";
import Query from "metabase/lib/query";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment