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:
parent
1320c697db
commit
ce1e1f741d
143 changed files with 1051 additions and 420 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue