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

fix issue where database create/update was still trying to call the...

fix issue where database create/update was still trying to call the db_form_input endpoint which we removed recently.
parent 647bae64
No related branches found
No related tags found
No related merge requests found
import _ from "underscore";
import MetabaseSettings from "metabase/lib/settings";
import DatabaseList from "./components/DatabaseList.jsx";
import DatabaseEdit from "./components/DatabaseEdit.jsx";
import _ from "underscore";
var DatabasesControllers = angular.module('metabaseadmin.databases.controllers', ['metabase.metabase.services']);
......@@ -49,13 +50,7 @@ DatabasesControllers.controller('DatabaseList', ['$scope', '$routeParams', 'Meta
}
};
// load engine info from form_input endpoint. We need this to convert DB engine keys (e.g. 'postgres') to display names (e.g. 'PostgreSQL')
Metabase.db_form_input(function(formInput){
$scope.engines = formInput.engines;
console.log('ENGINES: ', $scope.engines);
}, function(error) {
console.log('Error loading database form input: ', error);
});
$scope.engines = MetabaseSettings.get('engines');
// fetch DBs from the backend
Metabase.db_list(function(databases) {
......@@ -197,14 +192,11 @@ DatabasesControllers.controller('DatabaseEdit', ['$scope', '$routeParams', '$loc
$scope.details = {};
}
// Ok, now load the engines from the form_input API endpoint
Metabase.db_form_input(function(formInput){
$scope.engines = formInput.engines;
if ($routeParams.databaseId) loadExistingDB();
else prepareEmptyDB();
}, function(error){
console.log('Error loading database form input: ', error);
});
$scope.engines = MetabaseSettings.get('engines');
if ($routeParams.databaseId) {
loadExistingDB();
} else {
prepareEmptyDB();
}
}
]);
......@@ -7,10 +7,6 @@ var MetabaseServices = angular.module('metabase.metabase.services', [
MetabaseServices.factory('Metabase', ['$resource', '$cookies', 'MetabaseCore', function($resource, $cookies, MetabaseCore) {
return $resource('/api/meta', {}, {
db_form_input: {
url: '/api/database/form_input',
method: 'GET'
},
db_list: {
url: '/api/database/?org=:orgId',
method: 'GET',
......
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