<commit_before>angular.module('SectionsApp')
	.controller('NewFriendsCtrl', [
		'storage',
		'$vk',
		function (storage, $vk) {
			$this = this;

			$this.mark = function ($event, type, user_id) {
				$event.preventDefault();
				var method = false;
				switch (type) {
					case 'add' : method = 'friends.add'; break;
					case 'ban' : method = 'account.banUser'; break;
					case 'delete' : method = 'friends.delete'; break;
					case 'deleteAll' : method = 'friends.deleteAllRequests'; break;
				}

				if (method) {
					$vk.auth().then(function () {
						$vk.api(method, {
							user_id: user_id,
							access_token: $vk.stg.access_token,
						}).then(function (resp) {
							// Сделать что-то когда заявка обработана
						});
					});
				}
			}

			storage.ready.then(function (stg) {
				$this.stg = stg;
			});

		}
	])

	.directive('request', ['profile', function(profile) {
		return {
			restrict: 'E',
			replace: 'true',
			templateUrl:'../SectionApp/sections/NewFriends/request.tpl',
			scope: true,
			link: function ($scope, el, attr) {
				$scope.user = profile.getById(attr.userId);
	        }
		};
	}]);<commit_msg>Linting SectionApp/NewFriendsSection<commit_after>angular.module('SectionsApp')
	.controller('NewFriendsCtrl', ['storage', '$vk',
		function (storage, $vk) {
			const vm = this;

			vm.mark = function ($event, type, user_id) {
				$event.preventDefault();
				var method = false;
				switch (type) {
				case 'add'       : method = 'friends.add'; break;
				case 'ban'       : method = 'account.banUser'; break;
				case 'delete'    : method = 'friends.delete'; break;
				case 'deleteAll' : method = 'friends.deleteAllRequests'; break;
				}

				if (method) {
					$vk.auth().then(function () {
						$vk.api(method, {
							user_id: user_id,
							access_token: $vk.stg.access_token,
						}).then(function () {
							// Сделать что-то когда заявка обработана
						});
					});
				}
			};

			storage.ready.then(function (stg) {
				vm.stg = stg;
			});

		},
	])

	.directive('request', ['profile', function(profile) {
		return {
			restrict: 'E',
			replace: 'true',
			templateUrl:'../SectionApp/sections/NewFriends/request.tpl',
			scope: true,
			link: function ($scope, el, attr) {
				$scope.user = profile.getById(attr.userId);
			},
		};
	}]);
{'fraction_non_alphanumeric': 0.17340286831812254, 'fraction_numerical': 0.0, 'mean_word_length': 2.737012987012987, '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': '7554815', 'n_tokens_mistral': 1023, 'n_tokens_neox': 798, 'n_words': 155}