<commit_before>'use strict';

angular.module('publicApp')
  .controller('RippleTransactionsCtrl', ['$scope', '$http', '$location', '$route', '$routeParams', 'UserService', function ($scope, $http, $location, $route, $routeParams, $user) {
    if (!$user.isLogged) { $location.path('/login') };

    $scope.user = $user;
    $scope.rippleWithdrawal = {};

    $scope.createRippleWithdrawal = function() {
      var opts  = {};
      opts.from_currency = $scope.rippleWithdrawal.currency;
      opts.from_amount = parseFloat($scope.rippleWithdrawal.amount);
      opts.from_issuer = '<KEY>';
      opts.from_address = 'r4EwBWxrx5HxYRyisfGzMto3AT8FZiYdWk';

      opts.to_currency = $scope.rippleWithdrawal.currency;
      opts.to_amount = parseFloat($scope.rippleWithdrawal.amount);
      opts.to_issuer = '<KEY>';
      opts.to_address = 'r4EwBWxrx5HxYRyisfGzMto3AT8FZiYdWk';
      opts.issuance = true;

      opts.to_address = $scope.rippleWithdrawal.ripple_address;
      opts.from_address = $scope.rippleWithdrawal.ripple_address;

      opts.ripple_address_id = 3;
      
      $http.post('/api/v1/users/'+$user.id+'/ripple_transactions', opts, function(err, transaction) {
        console.log(err); 
        console.log(transaction);
      });
    }
  }]);<commit_msg>[FEATURE] Redirect to user page after creating ripple transaction.<commit_after>'use strict';

angular.module('publicApp')
  .controller('RippleTransactionsCtrl', ['$scope', '$http', '$location', '$route', '$routeParams', 'UserService', function ($scope, $http, $location, $route, $routeParams, $user) {
    if (!$user.isLogged) { $location.path('/login') };

    $scope.user = $user;
    $scope.rippleWithdrawal = {};

    $scope.createRippleWithdrawal = function() {
      var opts  = {};
      opts.from_currency = $scope.rippleWithdrawal.currency;
      opts.from_amount = parseFloat($scope.rippleWithdrawal.amount);
      opts.from_issuer = '<KEY>';
      opts.from_address = 'r4EwBWxrx5HxYRyisfGzMto3AT8FZiYdWk';

      opts.to_currency = $scope.rippleWithdrawal.currency;
      opts.to_amount = parseFloat($scope.rippleWithdrawal.amount);
      opts.to_issuer = '<KEY>';
      opts.to_address = 'r4EwBWxrx5HxYRyisfGzMto3AT8FZiYdWk';
      opts.issuance = true;

      opts.to_address = $scope.rippleWithdrawal.ripple_address;
      opts.from_address = $scope.rippleWithdrawal.ripple_address;

      opts.ripple_address_id = 3;
      
      $http.post('/api/v1/users/'+$user.id+'/ripple_transactions', opts, function(err, transaction) {
        console.log(err); 
        console.log(transaction);
        $location.path('/users/'+$user.id); 
      });
    }
  }]);
{'fraction_non_alphanumeric': 0.15544629349470498, 'fraction_numerical': 0.007564296520423601, 'mean_word_length': 3.7232142857142856, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2976323', 'n_tokens_mistral': 968, 'n_tokens_neox': 914, 'n_words': 123}