In T298697#7617206, @bd808 wrote:In T298697#7617144, @Slst2020 wrote:So would the way to go here be to modify the /api/lists/{list_pk}/revisions/{id}/ endpoint so that it returns the tools as a list of objects, just like /api/lists/{id}/ does?
I think this would be reasonable, yes. I think it would mostly be a matter of updating the ToolListRevisionDetailSerializer class used to render the retrieve action of ToolListRevisionViewSet to replace its embedded ToolListHistoricVersionSerializer member with a ToolListSerializer. It is probably a bit more complicated than this in practice as the data currently passed to ToolListHistoricVersionSerializer would only have the tool_names list of names and the tools many-to-many relation's full tool details.
In T298697#7619520, @Slst2020 wrote:In T298697#7617206, @bd808 wrote:I think it would mostly be a matter of updating the ToolListRevisionDetailSerializer class used to render the retrieve action of ToolListRevisionViewSet to replace its embedded ToolListHistoricVersionSerializer member with a ToolListSerializer. It is probably a bit more complicated than this in practice as the data currently passed to ToolListHistoricVersionSerializer would only have the tool_names list of names and the tools many-to-many relation's full tool details.
I'm not sure I'd be able to do this change myself as I'd need some time to get familiar with Django and the backend first.
For the data from the /api/lists/{id}/ and /api/lists/{list_pk}/revisions/{id}/ endpoints to be interchangeable in the ListView component so that it can be used to display both current lists and list revisions, the latter would have to return the following info:
- created_by
- created_date
- tools as a list of objects instead of as a list of tool names.
/api/lists/{id}/ returns all three of these, /api/lists/{list_pk}/revisions/{id}/ currently does not.