[chore] added prettier

This commit is contained in:
Jori Lallo
2017-04-26 21:47:03 -07:00
parent fcdeb67bc5
commit 08b1609440
53 changed files with 1983 additions and 928 deletions

View File

@ -1,28 +1,33 @@
import {
DataTypes,
sequelize,
} from '../sequelize';
import { DataTypes, sequelize } from '../sequelize';
import randomstring from 'randomstring';
const Team = sequelize.define('team', {
id: { type: DataTypes.UUID, defaultValue: DataTypes.UUIDV4, primaryKey: true },
name: DataTypes.STRING,
secret: { type: DataTypes.STRING, unique: true },
userId: {
type: DataTypes.UUID,
allowNull: false,
references: {
model: 'users',
const Team = sequelize.define(
'team',
{
id: {
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4,
primaryKey: true,
},
name: DataTypes.STRING,
secret: { type: DataTypes.STRING, unique: true },
userId: {
type: DataTypes.UUID,
allowNull: false,
references: {
model: 'users',
},
},
},
}, {
tableName: 'apiKeys',
paranoid: true,
hooks: {
beforeValidate: (key) => {
key.secret = randomstring.generate(38);
{
tableName: 'apiKeys',
paranoid: true,
hooks: {
beforeValidate: key => {
key.secret = randomstring.generate(38);
},
},
},
});
}
);
export default Team;