add id and author to cdli-tablet feed

Contributes #2623

Description

  • add id and author fields to the /cdli-tablet/feed JSON response so consumers (notably the upcoming mobile app) can use the tablet id for navigation/bookmarking and display the author for attribution; both fields are additive, no existing keys are changed

Type of PR

  • This PR is a feature.

Technicalities

  • added ->contain(['Authors']) to the feed query in CdliTabletController::feed() so the related Author is eager-loaded in one query
  • added 'id' => $result->id and 'author' => $result->author->author to the full feed entry

Checklist:

  • My pull request has a descriptive title (not a vague title like "Update index.md").
  • My pull request targets the phoenix/develop branch of the repository.
  • My commit messages follow best practices.
  • My code follows the established code style of the repository.
  • I added tests for the changes I made (if applicable).
  • I added or updated documentation (if applicable).
  • I tried running the project locally and verified that there are no visible errors.
Edited by Shiva Gupta

Merge request reports

Loading