1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-20 05:39:43 +02:00

Code formatting with prettier, change eslint config for the server

This commit is contained in:
Maksim Eltyshev 2019-11-05 18:01:42 +05:00
parent b7f37f0f96
commit a11f6260c0
191 changed files with 4321 additions and 2880 deletions

View file

@ -4,45 +4,47 @@ module.exports = {
inputs: {
values: {
type: 'json',
custom: value =>
_.isPlainObject(value) &&
_.isString(value.email) &&
_.isString(value.password),
required: true
// eslint-disable-next-line max-len
custom: (value) => _.isPlainObject(value) && _.isString(value.email) && _.isString(value.password),
required: true,
},
request: {
type: 'ref'
}
type: 'ref',
},
},
exits: {
conflict: {}
conflict: {},
},
fn: async function(inputs, exits) {
async fn(inputs, exits) {
const user = await User.create({
...inputs.values,
email: inputs.values.email.toLowerCase(),
password: bcrypt.hashSync(inputs.values.password, 10)
password: bcrypt.hashSync(inputs.values.password, 10),
})
.intercept({
message: 'Unexpected error from database adapter: conflicting key value violates exclusion constraint "user_email_unique"'
}, 'conflict')
.intercept(
{
message:
'Unexpected error from database adapter: conflicting key value violates exclusion constraint "user_email_unique"',
},
'conflict',
)
.fetch();
const userIds = await sails.helpers.getAdminUserIds();
userIds.forEach(userId => {
userIds.forEach((userId) => {
sails.sockets.broadcast(
`user:${userId}`,
'userCreate',
{
item: user
item: user,
},
inputs.request
inputs.request,
);
});
return exits.success(user);
}
},
};