52b6668955
- remove lodash from bower - move all resources to /mirage instead of /app/mirage - update endpoints to use ORM - general cleanup
19 lines
645 B
JavaScript
19 lines
645 B
JavaScript
import {Factory, faker} from 'ember-cli-mirage';
|
|
|
|
let randomDate = function randomDate(start = moment().subtract(30, 'days').toDate(), end = new Date()) {
|
|
return new Date(start.getTime() + Math.random() * (end.getTime() - start.getTime()));
|
|
};
|
|
|
|
let statuses = ['pending', 'subscribed'];
|
|
|
|
export default Factory.extend({
|
|
name() { return `${faker.name.firstName()} ${faker.name.lastName()}`; },
|
|
email: faker.internet.email,
|
|
status() { return statuses[Math.floor(Math.random() * statuses.length)]; },
|
|
createdAt() { return randomDate(); },
|
|
updatedAt: null,
|
|
createdBy: 0,
|
|
updatedBy: null,
|
|
unsubscribedAt: null
|
|
});
|