wellcomecollection / wellcomecollection.org

🪟 Wellcome Collection's website and services that support it
https://wellcomecollection.org
MIT License
39 stars 5 forks source link

Do we still need the multi-content endpoints? #10241

Open alexwlchan opened 1 year ago

alexwlchan commented 1 year ago

Currently we have a fairly complicated multi-content API in the front-end, e.g.

https://github.com/wellcomecollection/wellcomecollection.org/blob/10c0ef7011e6d1b1ce94723cbb7a66f9f1a95a70/content/webapp/services/prismic/fetch/multi-content.ts#L31

https://github.com/wellcomecollection/wellcomecollection.org/blob/10c0ef7011e6d1b1ce94723cbb7a66f9f1a95a70/content/webapp/services/prismic/transformers/multi-content.ts

This is only used to get a list of articles for the press releases page.

This code is quite complex and fiddly, and it seems like a lot for a single component of a single page – it theoretically exposes a mechanism for client-side code to make arbitrary queries of the Prismic API.

We should investigate whether there's a way to simplify some of this code.

This comes from https://github.com/wellcomecollection/platform/issues/5734

rcantin-w commented 7 months ago

Moving to experience board but I feel like if we prioritise the Content API, this one might not be necessary at some point...