-
Notifications
You must be signed in to change notification settings - Fork 23
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
SWC-7064 - Utilities for pre-upload #1353
Conversation
* @throws Error If an entity with given name and parent ID was found, but that entity | ||
* was not a File Entity. | ||
*/ | ||
export async function getFileEntityIdWithSameName( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the uploader, this function will tell us if we should ask the user if a file should be uploaded as a new version of an existing entity.
* Given the ID of a container entity and a path string array, create the folder structure as necessary and return the ID of the final folder in the path. | ||
* @returns The ID of the final folder in the path. | ||
*/ | ||
export function useCreateFolderPath() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When uploading an entire folder, we may need to create many nested folders. This hook handles creating those folders.
* Given a File to upload as a FileEntity, create a matching directory structure (as necessary) | ||
* and return the ID of the folder in which the file should be uploaded. | ||
*/ | ||
export function useCreatePathsAndGetParentId() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Convenience wrapper over the useCreateFolderPath
that takes a JavaScript File
and parses the webkitRelativePath
property to determine the path structure that should be created.
No description provided.