-
Notifications
You must be signed in to change notification settings - Fork 12
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
api: custom headers #48
Conversation
searchHeaders: { | ||
'Content-Type': 'application/rero+json' | ||
}, | ||
detailHeaders: { |
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.
Sounds like a bad name. You can use similar name than the invenio-records-rest API convention, i.e. list, item.
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.
done
return this.http.get<Record>(this.apiService.getEndpointByType(type, true) + '/', { params: httpParams }) | ||
let httpHeaders: HttpHeaders; | ||
if (headers) { | ||
httpHeaders = new HttpHeaders(headers); |
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.
this can be done with an inline if statement.
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.
done, and I created a method to factorize this.
* Adds a config to specify custom headers to api calls. Co-Authored-by: Sébastion Délèze <sebastien-deleze@rero.ch>
Co-Authored-by: Sébastion Délèze sebastien-deleze@rero.ch