diff --git a/app/pods/users/requestlockouthelp/controller.js b/app/pods/users/requestlockouthelp/controller.js index ccda273..2930b31 100644 --- a/app/pods/users/requestlockouthelp/controller.js +++ b/app/pods/users/requestlockouthelp/controller.js @@ -1,15 +1,18 @@ import Ember from 'ember'; import ajaxRequest from '../../../utils/ajax-request'; -export default Ember.Controller.extend({ - session: Ember.inject.service('session'), +const { Controller, inject: { service } } = Ember; + +export default Controller.extend({ + session: service(), + globals: service(), actions: { - save: function() { - let url = `${this.get('globals.apiURL')}/api/${this.get('globals.genus')}/users/lockout`; - let options = { + submit: function(email) { + const url = `${this.get('globals.apiURL')}/api/${this.get('globals.genus')}/users/lockout`; + const options = { method: 'POST', - data: { email: this.get('email') }, + data: { email: email }, }; ajaxRequest(url, options, this.get('session')); this.transitionToRoute('login'); diff --git a/app/pods/users/requestlockouthelp/lockout-form/component.js b/app/pods/users/requestlockouthelp/lockout-form/component.js new file mode 100644 index 0000000..2b7426f --- /dev/null +++ b/app/pods/users/requestlockouthelp/lockout-form/component.js @@ -0,0 +1,18 @@ +import Ember from 'ember'; + +const { Component } = Ember; + +export default Component.extend({ + email: null, + "on-submit": null, + + actions: { + save: function() { + return this.attrs["on-submit"](this.get('email')); + }, + + emailDidChange: function(value) { + this.set('email', value); + }, + } +}); diff --git a/app/pods/users/requestlockouthelp/lockout-form/template.hbs b/app/pods/users/requestlockouthelp/lockout-form/template.hbs new file mode 100644 index 0000000..5f18a09 --- /dev/null +++ b/app/pods/users/requestlockouthelp/lockout-form/template.hbs @@ -0,0 +1,18 @@ +