Skip to content

Allow custom upload session url in OneDriveLargeFileUpload.create #1010

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

Merged
merged 6 commits into from
Oct 19, 2022

Conversation

nikithauc
Copy link
Contributor

fixes #917.

OneDriveLargeFileUpload.create() defaults to creating an upload session for me/drive/root. Adding an option to pass any custom uploadSessionURL different than the default one.

@nikithauc nikithauc requested a review from gavinbarron October 17, 2022 18:22
@nikithauc nikithauc enabled auto-merge (squash) October 17, 2022 18:28
@gavinbarron
Copy link
Member

@@ -161,7 +166,7 @@ export class OneDriveLargeFileUploadTask<T> extends LargeFileUploadTask<T> {
if (!client || !fileObject || !options) {
throw new GraphClientError("Please provide the Graph client instance, FileObject interface implementation and OneDriveLargeFileUploadOptions value");
}
const requestUrl = OneDriveLargeFileUploadTask.constructCreateSessionUrl(options.fileName, options.path);
const requestUrl = options?.uploadSessionURL ? options.uploadSessionURL: OneDriveLargeFileUploadTask.constructCreateSessionUrl(options.fileName, options.path);
Copy link
Member

Choose a reason for hiding this comment

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

the optional chaining of options here is not needed as line 166 validates that options has a value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the optional

@nikithauc
Copy link
Contributor Author

Copy link
Member

@gavinbarron gavinbarron left a comment

Choose a reason for hiding this comment

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

LGTM!

@nikithauc nikithauc merged commit 821d8c2 into dev Oct 19, 2022
@baywet baywet deleted the nikithauc/#917-uploadsession-custom branch November 30, 2022 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants