-
Notifications
You must be signed in to change notification settings - Fork 231
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
Conversation
Should this PR also update https://github.com/microsoftgraph/msgraph-sdk-javascript/blob/dev/docs/tasks/LargeFileUploadTask.md ? |
@@ -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); |
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.
the optional chaining of options
here is not needed as line 166 validates that options has a value.
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.
Removed the optional
…com/microsoftgraph/msgraph-sdk-javascript into nikithauc/#917-uploadsession-custom
Updated. Please verify :) |
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.
LGTM!
fixes #917.
OneDriveLargeFileUpload.create()
defaults to creating an upload session forme/drive/root
. Adding an option to pass any customuploadSessionURL
different than the default one.