Closed codycooperross closed 11 months ago
I think this is probably because the id
exposed by the serializer is not actually the id
field: https://github.com/datacite/lupo/blob/master/app/serializers/activity_serializer.rb#L7
The controller uses a slightly weird pattern in that it calls a separate function to get the Activity record before processing the show
route: https://github.com/datacite/lupo/blob/master/app/controllers/activities_controller.rb#L6 and https://github.com/datacite/lupo/blob/master/app/controllers/activities_controller.rb#L147-L151. I don't know if there is a reason for this vs what I would consider to be the standard pattern of the show
controller doing the lookup (c.f. https://github.com/datacite/lupo/blob/master/app/controllers/datacite_dois_controller.rb#L435-L448)
I suspect if you used the value from the actual id
field in the DB/ES record, it would probably work.
As a side note, /activities appears to be currently broken in test/production :grimacing:
I suspect if you used the value from the actual
id
field in the DB/ES record, it would probably work.
I actually tried this, and I'm not sure it does, but worth investigating further.
As a side note, /activities appears to be currently broken in test/production 😬
We're working on this! See #1054 #1062
Closing. Fixed by https://github.com/datacite/lupo/pull/1063
Describe the bug
It should be possible to retrieve single Activity records via the REST API based on the
id
listed in theactivities
endpoints for a given Activity. However, attempting to retrieve an activity using itsid
at/activities/[id]
returns a 404.Expected Behaviour
Retrieving an Activity based on its
id
in the REST API returns an individual Activity record.Current Behaviour
Retrieving an Activity based on its
id
in the REST API returns a 404.Steps to Reproduce
Retrieve a list of activities at the
/activities
endpoint or another relevant endpoint like/dois/[doi]/activities
. Attempt to retrieve a single activity using itsid
in the REST API at/activities/[id]
.Context (Environment)
Screenshots
Further details
Proposal
Hypothesis
Possible Implementation