mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-13 22:41:32 -05:00
81eb705a37
addresses #2422 - creates settings user controller - creates user model object - updates user fixture to be compatible with user model - updates settings/user template - add validator to Ember Admin - use validator to validate user model is valid - add mock response to /users/me/ path - creates models/base file for all models to inherit from - add mock response to /ghost/changepw/ path
26 lines
No EOL
707 B
JavaScript
26 lines
No EOL
707 B
JavaScript
import User from 'ghost/models/user';
|
|
import userFixtures from 'ghost/fixtures/users';
|
|
|
|
var currentUser = {
|
|
name: 'currentUser',
|
|
|
|
initialize: function (container) {
|
|
container.register('user:current', User);
|
|
}
|
|
};
|
|
|
|
var injectCurrentUser = {
|
|
name: 'injectCurrentUser',
|
|
|
|
initialize: function (container) {
|
|
if (container.lookup('user:current')) {
|
|
// @TODO: remove userFixture
|
|
container.lookup('user:current').setProperties(userFixtures.findBy('id', 1));
|
|
|
|
container.injection('route', 'user', 'user:current');
|
|
container.injection('controller', 'user', 'user:current');
|
|
}
|
|
}
|
|
};
|
|
|
|
export {currentUser, injectCurrentUser}; |