Improved code quality (#13020)

pull/11124/merge
Pierre H. Lehnen 7 years ago committed by Rodrigo Nascimento
parent 8779fed585
commit af60043217
  1. 2
      packages/rocketchat-importer/server/classes/ImporterBase.js
  2. 1
      packages/rocketchat-importer/server/methods/downloadPublicImportFile.js
  3. 3
      packages/rocketchat-importer/server/methods/uploadImportFile.js

@ -99,7 +99,7 @@ export class Base {
this.progress = new Progress(this.info.key, this.info.name);
this.collection = RawImports;
const userId = Meteor.user()._id;
const userId = Meteor.userId();
const importRecord = Imports.findPendingImport(this.info.key);
if (importRecord) {

@ -7,7 +7,6 @@ import http from 'http';
Meteor.methods({
downloadPublicImportFile(fileUrl, importerKey) {
const userId = Meteor.userId();
console.log(fileUrl);
if (!userId) {
throw new Meteor.Error('error-invalid-user', 'Invalid user', { method: 'downloadPublicImportFile' });

@ -30,9 +30,6 @@ Meteor.methods({
const readStream = RocketChatFile.bufferToStream(file);
const writeStream = RocketChatImportFileInstance.createWriteStream(newFileName, contentType);
writeStream.on('end', Meteor.bindEnvironment(() => {
}));
readStream.pipe(writeStream);
},
});

Loading…
Cancel
Save