TryGhost/Ghost

View on GitHub
ghost/admin/mirage/factories/api-key.js

Summary

Maintainability
A
0 mins
Test Coverage
import moment from 'moment-timezone';
import {Factory} from 'miragejs';

export default Factory.extend({
    type: 'content',
    secret() {
        if (this.integration) {
            return `${this.integration.slug}_${this.type}_key-12345`;
        }
        return `${this.type}_key-12345`;
    },
    lastSeenAt() {
        return moment.utc().format();
    },

    createdAt() { return moment.utc().format(); },
    createdBy: 1,
    updatedAt() { return moment.utc().format(); },
    updatedBy: 1
});