Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: save file locally when receiving postFile message #317

Merged
merged 3 commits into from
Sep 4, 2020

Conversation

pyphilia
Copy link
Contributor

@pyphilia pyphilia commented Aug 31, 2020

This PR enables to receive file information from an app, and save the file in the database.

Copy link
Member

@juancarlosfarah juancarlosfarah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good to me! Just some minor changes and some optimisation. Maybe @hasanagh can check before merging. Thanks!

@@ -84,6 +85,12 @@ const ACTIONS_VERBS = {
LOGOUT: 'logout',
};

const buildFilesPath = ({ userId, spaceId, name }) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be singular buildFilePath?

/**
* Ensure directories for given filepath exist
*/
function ensureDirectoryExistence(filePath) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should use fs-extra instead of creating this function? Probably has some in-built safety.

const fs = require('fs-extra');
fs.ensureDirSync(...);

@juancarlosfarah juancarlosfarah merged commit a3a7851 into master Sep 4, 2020
@juancarlosfarah juancarlosfarah deleted the 242/postFile branch September 4, 2020 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants