-
Notifications
You must be signed in to change notification settings - Fork 116
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
fix(api): Add support for http interceptors #1039
Conversation
Verified that @mickr has signed the CLA. Thanks for the pull request! |
I have updated the other feedback on this PR and I'm going to start working on the api layer refactor. |
569c80b
to
1e271e2
Compare
The tests have not been updated, I want to go over the changes in the PR before updating the test implementation. |
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.
Approach looks reasonable to me.
@@ -4,7 +4,7 @@ import EventEmitter from 'events'; | |||
import cloneDeep from 'lodash/cloneDeep'; | |||
import throttle from 'lodash/throttle'; | |||
/* eslint-enable import/first */ | |||
import api from './api'; | |||
import Api from './api'; |
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.
I think the preference is that acronyms be uppercased
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.
What if we are trying to denote that it is a class that requires new
?
|
||
// Otherwise, get the content download URL of the original file and download | ||
} else { | ||
const getDownloadUrl = appendQueryParams(getDownloadURL(this.file.id, apiHost), queryParams); | ||
api.get(getDownloadUrl, { headers: this.getRequestHeaders() }).then(data => { | ||
this.api.get(getDownloadUrl, { headers: this.getRequestHeaders() }).then(data => { |
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 a follow-up, we could probably generalize this to this.api.file.getDownloadUrl
and hide the reachability checks from the consumer entirely.
cac3825
to
8b8516a
Compare
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.
Nice job.
* Add support for using passed in request/response http interceptors. * Add request and response interceptors to documentation * Convert metadata API to a class and encapsulate within the API * Add DownloadReachability to API
15d79c5
to
583183a
Compare
Changed instantiation point to the constructor and updated the tests.
No description provided.