Hi I'm trying to understand the way promises work along with Ajax calls.
I want to send a simple Ajax call to a certain end point but I'm really confused with the code syntax. Here is my code:

The purpose of the code is to invalidate the session of the user. First, the client should send an ajax call to the logout endpoint providing the user's token and then if the server responds successfully, we call the invalidate() method to clear the user's data from the client side.

```
import Ember from 'ember';

export default Ember.Controller.extend({
    session: Ember.inject.service('session'),

    actions: { 
       invalidateSession() {
        const url = "http://namespace/logout/";
        let logoutRequest = new Ember.RSVP.Promise(function(r,e){
            r(this.ajax(url, "PUT", {auth_token});)
        },
        if (logoutRequest) {
            this.get('session').invalidate();
        }
      }
    }
});

```

I Know that my code doesn't working but I can't put it all together...