Skip to content

Conversation

matt-bernhardt
Copy link
Member

@matt-bernhardt matt-bernhardt commented Apr 19, 2023

** Why are these changes being introduced:

  • The experts endpoint in the API has a featured_media field, which by default is returned as the ID of the image in that field. However, the legacy platform has overridden this value to be the URL for the image instead, so that the homepage doesn't need to perform a second call in order to load the image.

** Relevant ticket(s):

** How does this address that need:

  • This brings forward the api_get_image function from the legacy parent theme, which replaces the image ID with just the URL to the image size we need (for the experts endpoint only)

** Document any side effects to this change:

  • The behavior of the experts endpoint is now different from others, like the pages or posts endpoint. The featured_media field is a URL in one, but still the image ID in others.

Developer

Secrets

  • No secrets are affected

Documentation

  • No documentation changes are needed

Accessibility

  • ANDI or Wave has been run in accordance to
    our guide and
    all issues introduced by these changes have been resolved or opened as new
    issues (link to those issues in the Pull Request details above)

Stakeholder approval

  • Stakeholder approval has been given

Dependencies

NO dependencies are updated

Code Reviewer

  • The commit message is clear and follows our guidelines
    (not just this pull request message)
  • The changes have been verified
  • The documentation has been updated or is unnecessary
  • New dependencies are appropriate or there were no changes

@matt-bernhardt matt-bernhardt requested a review from JPrevost April 19, 2023 15:28
@JPrevost JPrevost self-assigned this Apr 19, 2023
** Why are these changes being introduced:

* The experts endpoint in the API has a featured_media field, which by
  default is returned as the ID of the image in that field. However, the
  legacy platform has overridden this value to be the URL for the image
  instead, so that the homepage doesn't need to perform a second call in
  order to load the image.

** Relevant ticket(s):

* https://mitlibraries.atlassian.net/browse/lm-304

** How does this address that need:

* This brings forward the api_get_image function from the legacy parent
  theme, which replaces the image ID with just the URL to the image size
  we need (for the experts endpoint only)

** Document any side effects to this change:

* The behavior of the experts endpoint is now different from others,
  like the pages or posts endpoint. The featured_media field is a URL in
  one, but still the image ID in others.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants