News for hackers. Stuff that matters.
Re:Don’t Build a General Purpose API to Power Your Own Front... by rvnx on Sunday August 20, 2023 @01:31PM (#37201203)
It’s a very weird way of doing things.

The result with this strategy is that you may need the companyName and end-up at some point with code that does back:

companyName = pageTitle

or worse:

companyName = pageTitle.split(‘ - ‘)[0]

Because there is a moment when you will need to get the companyName again for some comparison or something whatever logic (e.g. is selected account profile current company ?)

This feels very confusing.

Instead pass companyName and keep it that way until the very last moment that you display it on the page (e.g. when rendering the view/template)

Re:Don’t Build a General Purpose API to Power Your Own Front... by hakunin on Sunday August 20, 2023 @01:37PM (#37201264)
The whole point is that when you need companyName for another thing, you should create a parameter `anotherThing` and backend will set companyName into it as well. It's designed to make it very weird to _not_ do that, so that you don't do that.
Re:Don’t Build a General Purpose API to Power Your Own Front... by rvnx on Sunday August 20, 2023 @01:40PM (#37201293)
firstDivOnThePageBeforeMainMenuBlock ?