eHealthAfrica/direct-delivery-dashboard

View on GitHub
src/app/planning/delivery-round/delivery-round.states.js

Summary

Maintainability
A
0 mins
Test Coverage
'use strict'

angular.module('planning')
  .config(function ($stateProvider) {
    $stateProvider.state('planning.deliveryRound', {
      url: '/delivery-round',
      templateUrl: 'app/planning/delivery-round/index.html',
      controller: 'DeliveryRoundCtrl',
      controllerAs: 'crCtrl',
      resolve: {
        deliveryRounds: function (planningService, authService) {
          return authService.getUserSelectedState(true)
            .then(function (state) {
              return planningService.byAuthorisedStates([state])
            })
            .catch(function () {
              return []
            })
        }
      },
      data: {
        label: 'Planning'
      }
    })
  })