"use strict";
appCore.controller("NewsletterArchiveListCtrl", ["$state", "$scope", "$http", "$timeout", "vServices", function ($state, $scope, $http, $timeout, vServices) {
    $scope.$root.page.title = "List of Newsletter Archive";
    $scope.newsletters = [];
    const init = function () {
        vServices.callApi("newsletter/allNewsletterArchive", "GET", {}).then(function (res) {
            // console.log(res);
            if (res && res.length > 0) {
                res.forEach(e => {
                    e.isShow = e.cty_location ? e.cty_location.includes(","+$scope.$root.gUser.emp_country+",") : false;
                });
                $scope.newsletters = res;
                $scope.$root.callDataTable("#newsLetterList");
            }
        });
    };
    init();
}]);