<commit_before>require([
    'backbone',
    'collections/category_collection',
    'collections/enterprise_customer_collection',
    'ecommerce',
    'routers/enterprise_coupon_router',
    'utils/navigate'
],
    function(Backbone,
              CategoryCollection,
              EnterpriseCustomerCollection,
              ecommerce,
              CouponRouter,
              navigate) {
        'use strict';

        $(function() {
            var $app = $('#app'),
                couponApp = new CouponRouter({$el: $app});

            ecommerce.coupons = ecommerce.coupons || {};
            ecommerce.coupons.categories = new CategoryCollection();
            ecommerce.coupons.categories.url = '/api/v2/coupons/categories/';
            ecommerce.coupons.categories.fetch({async: false});

            ecommerce.coupons.enterprise_customers = new EnterpriseCustomerCollection();
            ecommerce.coupons.enterprise_customers.fetch({async: false});

            couponApp.start();

            // Handle navbar clicks.
            $('a.navbar-brand').on('click', navigate);

            // Handle internal clicks
            $app.on('click', 'a', navigate);
        });
    }
);<commit_msg>Updates enterprise coupon page to make fetch calls async<commit_after>require([
    'backbone',
    'collections/category_collection',
    'collections/enterprise_customer_collection',
    'ecommerce',
    'routers/enterprise_coupon_router',
    'utils/navigate'
],
    function(Backbone,
              CategoryCollection,
              EnterpriseCustomerCollection,
              ecommerce,
              CouponRouter,
              navigate) {
        'use strict';

        $(function() {
            var startApp = function() {
                var $app = $('#app'),
                    couponApp = new CouponRouter({$el: $app});
                couponApp.start();

                // Handle navbar clicks.
                $('a.navbar-brand').on('click', navigate);

                // Handle internal clicks
                $app.on('click', 'a', navigate);
            };

            ecommerce.coupons = ecommerce.coupons || {};
            ecommerce.coupons.categories = new CategoryCollection();
            ecommerce.coupons.categories.url = '/api/v2/coupons/categories/';

            ecommerce.coupons.enterprise_customers = new EnterpriseCustomerCollection();

            $.when(
                ecommerce.coupons.categories.fetch(),
                ecommerce.coupons.enterprise_customers.fetch()
            ).always(startApp());
        });
    }
);
{'fraction_non_alphanumeric': 0.12193221659524738, 'fraction_numerical': 0.0007791195948578107, 'mean_word_length': 1.9148694665153234, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7245820', 'n_tokens_mistral': 674, 'n_tokens_neox': 674, 'n_words': 109}