Skip to content

Commit

Permalink
[IMPROVE] User data export (#15294)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hudell authored and sampaiodiego committed Sep 19, 2019
1 parent e0d5153 commit 968fbd9
Show file tree
Hide file tree
Showing 7 changed files with 248 additions and 110 deletions.
4 changes: 4 additions & 0 deletions app/file-upload/server/config/GridFS.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,8 @@ new FileUploadClass({

return readFromGridFS(file.store, file._id, file, req, res);
},

copy(file, out) {
copyFromGridFS(file.store, file._id, file, out);
},
});
19 changes: 18 additions & 1 deletion app/models/server/models/ExportOperations.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ export class ExportOperations extends Base {
return this.find(query, options);
}

findOnePending(options) {
const query = {
status: { $nin: ['completed'] },
};

return this.findOne(query, options);
}

findAllPendingBeforeMyRequest(requestDay, options) {
const query = {
status: { $nin: ['completed'] },
Expand All @@ -63,6 +71,13 @@ export class ExportOperations extends Base {
status: data.status,
fileList: data.fileList,
generatedFile: data.generatedFile,
fileId: data.fileId,
userNameTable: data.userNameTable,
userData: data.userData,
generatedUserFile: data.generatedUserFile,
generatedAvatar: data.generatedAvatar,
exportPath: data.exportPath,
assetsPath: data.assetsPath,
},
};

Expand All @@ -78,7 +93,9 @@ export class ExportOperations extends Base {

_.extend(exportOperation, data);

return this.insert(exportOperation);
this.insert(exportOperation);

return exportOperation._id;
}


Expand Down
Loading

0 comments on commit 968fbd9

Please sign in to comment.