import { map } from 'lodash' ; import api from 'teleport/services/api' ; import cfg from 'teleport/config' ; import makeDatabase from './makeDatabase' ; class DatabaseService { fetchDatabases ( clusterId ? ) { return api . get ( cfg . getDatabasesUrl ( clusterId ) ) . then ( json => map ( json , makeDatabase ) ) ; } } export default DatabaseService ;