Skip to content

Add Endpoint to Get Metadata History by Id

@jmfee @pcain for discussion

It would be very useful to be able to query the "metadata_history" table in the same way that we make GET requests to the "metadata" table.

metadata table:

  • metadata/ (all) use params
  • metadata/:id (single)

metadata_history table (current):

  • metadata/:id/history (return metadata[], based on metadata.id)
  • *new endpoint* (return metadata, based on metadata_history.id)

I don't think we need to ability to query against all MetadataQueryParams on the "metadata_history" table, but it would be nice to have an endpoint that allows us to get the metadata history record based on metadata_history.id. This would allow us to build our application on the front-end in a similar manner when requesting old versions to edit.

Proposed Changes:
metadata_history table (option 1)

  • metadata/history/ use params, get single record with { "id": 1 }
  • metadata/history/:id use metadata_id, query for all records with metadata_id

metadata_history table (option 2)

  • metadata/:metadata_id/history (current, get by metadata_id)
  • metadata/:metadata_id/history/:id (new, get my id)
Edited by Eddie J Hunter