Automatically change instances of .success to .then with this linux script:

#Run in awx/awx/ui/client/src

    #!/bin/bash -ex
    FILES=`grep -l -R "\.success(\s*function\s*(data)\s*{" . | xargs`
    sed -i "s/\.success(\s*function\s*(data)\s*{/\.then(({data}) => {/g" $FILES

    FILES=`grep -l -R "\.success(\s*function\s*()\s*{" . | xargs`
    sed -i "s/\.success(\s*function\s*()\s*{/\.then(() => {/g" $FILES

    FILES=`grep -l -R "\.success(this\.success\.bind(this))" . | xargs`
    sed -i "s/\.success(this\.success\.bind(this))/\.then(this\.then\.bind(this))/g" $FILES
This commit is contained in:
Ben Thomasson
2017-10-04 13:18:30 -04:00
committed by Marliana Lara
parent fabdab78ef
commit 834e6c692c
91 changed files with 194 additions and 194 deletions

View File

@@ -139,7 +139,7 @@ export default ['$log', '$cookies', '$compile', '$rootScope',
scope.removeAuthorizationGetUser = scope.$on('AuthorizationGetUser', function() {
// Get all the profile/access info regarding the logged in user
Authorization.getUser()
.success(function (data) {
.then(({data}) => {
Authorization.setUserInfo(data);
Timer.init().then(function(timer){
$rootScope.sessionTimer = timer;