making changes suggested in review and improving typings

This commit is contained in:
Torkel Ödegaard
2019-02-06 17:31:52 +01:00
parent a53c3b45fc
commit 8574dca081
7 changed files with 97 additions and 45 deletions

View File

@@ -1,6 +1,3 @@
// Libaries
import { ThunkAction } from 'redux-thunk';
// Services & Utils
import { getBackendSrv } from 'app/core/services/backend_srv';
import { actionCreatorFactory, noPayloadActionCreatorFactory } from 'app/core/redux';
@@ -11,7 +8,7 @@ import { loadPluginDashboards } from '../../plugins/state/actions';
import { notifyApp } from 'app/core/actions';
// Types
import { StoreState } from 'app/types';
import { ThunkResult } from 'app/types';
import {
DashboardAcl,
DashboardAclDTO,
@@ -26,8 +23,6 @@ export const setDashboardLoadingState = actionCreatorFactory<DashboardLoadingSta
export const setDashboardModel = actionCreatorFactory<MutableDashboard>('SET_DASHBOARD_MODEL').create();
export const setDashboardLoadingSlow = noPayloadActionCreatorFactory('SET_DASHBOARD_LOADING_SLOW').create();
export type ThunkResult<R> = ThunkAction<R, StoreState, undefined, any>;
export function getDashboardPermissions(id: number): ThunkResult<void> {
return async dispatch => {
const permissions = await getBackendSrv().get(`/api/dashboards/id/${id}/permissions`);