mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 22:02:11 +03:00
9adbcd1fd0
no issue Automated tools, code generators, and editor integrations are increasingly standardising on the import style used in `ember-modules-codemod`. Our import style differed a little with regards to service/controller injection imports which meant we were starting to see inconsistent naming.
37 lines
1.0 KiB
JavaScript
37 lines
1.0 KiB
JavaScript
/* eslint camelcase: [2, {properties: "never"}] */
|
|
import Model from 'ember-data/model';
|
|
import attr from 'ember-data/attr';
|
|
import {belongsTo} from 'ember-data/relationships';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default Model.extend({
|
|
token: attr('string'),
|
|
email: attr('string'),
|
|
expires: attr('number'),
|
|
createdAtUTC: attr('moment-utc'),
|
|
createdBy: attr('number'),
|
|
updatedAtUTC: attr('moment-utc'),
|
|
updatedBy: attr('number'),
|
|
status: attr('string'),
|
|
role: belongsTo('role', {async: false}),
|
|
|
|
ajax: service(),
|
|
ghostPaths: service(),
|
|
|
|
resend() {
|
|
let fullInviteData = this.toJSON();
|
|
|
|
let inviteData = {
|
|
email: fullInviteData.email,
|
|
role_id: fullInviteData.role
|
|
};
|
|
|
|
let inviteUrl = this.get('ghostPaths.url').api('invites');
|
|
|
|
return this.get('ajax').post(inviteUrl, {
|
|
data: JSON.stringify({invites: [inviteData]}),
|
|
contentType: 'application/json'
|
|
});
|
|
}
|
|
});
|