app/controllers/setup/two.js
/**
     * Uploads the given data image, then sends the changed user image property to the server
     * @param  {Object} user User object, returned from the 'setup' api call
     * @return {Ember.RSVP.Promise} A promise that takes care of both calls
     */
Uploads the given data image, then sends the changed user image property to the server
@param  {Object} user User object, returned from the 'setup' api call
@return {Ember.RSVP.Promise} A promise that takes care of both calls
Uploads the given data image then sends the changed user image property to the server @param { Object } user User object returned from the ' setup ' api call @return { Ember . RSVP . Promise } A promise that takes care of both calls
sendImage(user) {
        let image = this.get('image');
        return new Promise((resolve, reject) => {
            image.formData = {};
            image.submit()
                .success((response) => {
                    let usersUrl = this.get('ghostPaths.url').api('users', user.id.toString());
                    user.image = response;
                    return this.get('ajax').put(usersUrl, {
                        data: {
                            users: [user]
                        }
                    }).then(resolve).catch(reject);
                })
                .error(reject);
        });
    }
sendImage ( user ) { let image = this . get ( 'image' ) ; return new Promise ( ( resolve , reject ) => { image . formData = { } ; image . submit ( ) . success ( ( response ) => { let usersUrl = this . get ( 'ghostPaths.url' ) . api ( 'users' , user . id . toString ( ) ) ; user . image = response ; return this . get ( 'ajax' ) . put ( usersUrl , { data : { users : [ user ] } } ) . then ( resolve ) . catch ( reject ) ; } ) . error ( reject ) ; } ) ; }
Uploads the given data image, then sends the changed user image property to the server
 @param  {Object} user User object, returned from the 'setup' api call
 @return {Ember.RSVP.Promise} A promise that takes care of both calls
Uploads the given data image then sends the changed user image property to the server @param { Object } user User object returned from the ' setup ' api call @return { Ember . RSVP . Promise } A promise that takes care of both calls