import { DataViewsService } from '../../../../../../src/plugins/data_views/common' ; export class DataViewHandler { constructor ( private dataViewService ) { } async getDataViewId ( indexName ) { const dv = ( await this . dataViewService . find ( indexName ) ) . find ( ( { title } ) => title === indexName ) ; return dv ?. id ; } async deleteDataViewById ( dataViewId ) { return await this . dataViewService . delete ( dataViewId ) ; } }