import { IStorageDestinationItem } from '../../interfaces' ; import { IThunkAction } from '../types' ; import { RECEIVE , IStorageDestinationActionTypes } from './types' ; import { samsApi } from '../../apis' ; export function receiveDestinations ( destinations ) { return { type : RECEIVE , payload : destinations , } ; } export function loadStorageDestinations ( ) { return ( dispatch ) => { return samsApi . storageDestinations . getAll ( ) . then ( ( destinations ) => { dispatch ( receiveDestinations ( destinations ) ) ; return Promise . resolve ( destinations ) ; } ) ; } ; }