Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unique IDs for record images (LIV) #767

Merged
merged 1 commit into from
Apr 12, 2024
Merged

Conversation

alycejenni
Copy link
Member

Records and images actually have a many-to-many relationship, but on the LIV it's been defined as a one-to-many; using the URL as an ID for the image was causing subsequent references to the same image to overwrite the previous record associations, so some records did not have any images (or at least were missing some of their images).

This also caused long loading times because the image would be requested for every record but only shown for the last. Using an ID that is unique to the resource, record, and image means that images are repeated but that's probably clearer anyway.

Records and images actually have a many-to-many relationship, but here it's been defined as a one-to-many; using the url as an id for the image was causing subsequent references to the same image to overwrite the previous record associations, so some records did not have any images. This also caused long loading times because the image would be requested for every record but only shown for the last.
Using an id that is unique to the resource, record, and image means that images are repeated but that's probably clearer anyway.
@alycejenni alycejenni merged commit 1621a6d into dev Apr 12, 2024
2 checks passed
@alycejenni alycejenni deleted the ginger/record-image-id branch April 12, 2024 11:16
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.

1 participant