mirror of
https://github.com/plankanban/planka.git
synced 2025-12-20 09:15:39 +03:00
feat: Track storage usage
This commit is contained in:
@@ -91,10 +91,10 @@ module.exports = {
|
||||
throw Errors.INVALID_SIGNATURE;
|
||||
}
|
||||
|
||||
user = await User.qm.updateOne(user.id, {
|
||||
({ user } = await User.qm.updateOne(user.id, {
|
||||
termsSignature,
|
||||
termsAcceptedAt: new Date().toISOString(),
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
const config = await Config.qm.getOneMain();
|
||||
|
||||
@@ -91,7 +91,7 @@ module.exports = {
|
||||
if (inputs.type === Attachment.Types.FILE) {
|
||||
let files;
|
||||
try {
|
||||
files = await sails.helpers.utils.receiveFile('file', this.req);
|
||||
files = await sails.helpers.utils.receiveFile(this.req.file('file'));
|
||||
} catch (error) {
|
||||
return exits.uploadError(error.message); // TODO: add error
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ module.exports = {
|
||||
|
||||
let files;
|
||||
try {
|
||||
files = await sails.helpers.utils.receiveFile('file', this.req);
|
||||
files = await sails.helpers.utils.receiveFile(this.req.file('file'));
|
||||
} catch (error) {
|
||||
return exits.uploadError(error.message); // TODO: add error
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ module.exports = {
|
||||
},
|
||||
},
|
||||
|
||||
async fn(inputs) {
|
||||
async fn(inputs, exits) {
|
||||
const { currentUser } = this.req;
|
||||
|
||||
const project = await Project.qm.getOneById(inputs.projectId);
|
||||
@@ -78,7 +78,7 @@ module.exports = {
|
||||
if (inputs.importType) {
|
||||
let files;
|
||||
try {
|
||||
files = await sails.helpers.utils.receiveFile('importFile', this.req);
|
||||
files = await sails.helpers.utils.receiveFile(this.req.file('importFile'), false);
|
||||
} catch (error) {
|
||||
return exits.uploadError(error.message); // TODO: add error
|
||||
}
|
||||
@@ -114,11 +114,11 @@ module.exports = {
|
||||
request: this.req,
|
||||
});
|
||||
|
||||
return {
|
||||
return exits.success({
|
||||
item: board,
|
||||
included: {
|
||||
boardMemberships: [boardMembership],
|
||||
},
|
||||
};
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
@@ -79,7 +79,7 @@ module.exports = {
|
||||
let readStream;
|
||||
try {
|
||||
readStream = await fileManager.read(
|
||||
`${sails.config.custom.attachmentsPathSegment}/${attachment.data.fileReferenceId}/thumbnails/${inputs.fileName}.${inputs.fileExtension}`,
|
||||
`${sails.config.custom.attachmentsPathSegment}/${attachment.data.uploadedFileId}/thumbnails/${inputs.fileName}.${inputs.fileExtension}`,
|
||||
);
|
||||
} catch (error) {
|
||||
throw Errors.FILE_ATTACHMENT_NOT_FOUND;
|
||||
|
||||
@@ -72,7 +72,7 @@ module.exports = {
|
||||
let readStream;
|
||||
try {
|
||||
readStream = await fileManager.read(
|
||||
`${sails.config.custom.attachmentsPathSegment}/${attachment.data.fileReferenceId}/${attachment.data.filename}`,
|
||||
`${sails.config.custom.attachmentsPathSegment}/${attachment.data.uploadedFileId}/${attachment.data.filename}`,
|
||||
);
|
||||
} catch (error) {
|
||||
throw Errors.FILE_ATTACHMENT_NOT_FOUND;
|
||||
|
||||
@@ -58,7 +58,7 @@ module.exports = {
|
||||
|
||||
let files;
|
||||
try {
|
||||
files = await sails.helpers.utils.receiveFile('file', this.req);
|
||||
files = await sails.helpers.utils.receiveFile(this.req.file('file'));
|
||||
} catch (error) {
|
||||
return exits.uploadError(error.message); // TODO: add error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user