hummingbird-me/hummingbird

View on GitHub
frontend/app/controllers/apps/mine.js

Summary

Maintainability
A
0 mins
Test Coverage
import Ember from 'ember';
import ajax from 'ic-ajax';

export default Ember.ArrayController.extend({
  newAppName: '',
  actions: {
    createApp: function() {
      var self = this;
      ajax({
        url: '/apps',
        type: 'POST',
        data: {
          name: this.get('newAppName')
        }
      }).then(function() {
        self.set('newAppName', '');
        location.reload();
      });
    }
  }
});