1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-19 13:19:44 +02:00

Add username to user

This commit is contained in:
Maksim Eltyshev 2020-04-03 00:35:25 +05:00
parent 1320c697db
commit ce1e1f741d
143 changed files with 1051 additions and 420 deletions

View file

@ -7,7 +7,7 @@ const sharp = require('sharp');
const Errors = {
USER_NOT_FOUND: {
notFound: 'User is not found',
userNotFound: 'User not found',
},
};
@ -32,9 +32,7 @@ const createReceiver = () => {
}
firstFileHandled = true;
const resize = sharp()
.resize(36, 36)
.jpeg();
const resize = sharp().resize(36, 36).jpeg();
const transform = new stream.Transform({
transform(chunk, streamEncoding, callback) {
@ -71,10 +69,10 @@ module.exports = {
},
exits: {
notFound: {
userNotFound: {
responseType: 'notFound',
},
unprocessableEntity: {
uploadError: {
responseType: 'unprocessableEntity',
},
},
@ -97,11 +95,11 @@ module.exports = {
this.req.file('file').upload(createReceiver(), async (error, files) => {
if (error) {
return exits.unprocessableEntity(error.message);
return exits.uploadError(error.message);
}
if (files.length === 0) {
return exits.unprocessableEntity('No file was uploaded');
return exits.uploadError('No file was uploaded');
}
user = await sails.helpers.updateUser(