always return shelf footer url - generate fallback (original) (raw)

Currently, a Shelf has an optional footer.url, which is the link that is displayed on the homepage to see more addons from that Shelf, and a footer.text to accompany it. Both are optional, and if not provided default to See more {shelf.title} for the latter, and either /collections/{MOZILLA_USER_ID}/{shelf.criteria}/ for collections or /search/{shelf.criteria} otherwise for the former. This means that frontend needs to duplicate the logic about how each shelf works to be able to generate the footer if not provided.

Instead, lets generate this in the API and always return the footer content so the logic only needs to be in once place, and adding new types in server doesn't (necessarily) mean adjusting the supporting code in frontend.