mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-25 09:51:42 -05:00
Content and subject are user-submitted so are effectively unbounded in size. And we’re serialising them for every template when sending the list of templates to the admin app. For the service with the most templates this results in a 1.3Mb blob of JSON going over the wire, and being cached in Redis. And then the admin app completely ignores these fields, because it does show template content until you’ve clicked into a single template. This commit adds a new query parameter, `detailed`, that the admin app can set to `False`. When it does only the fields needed to render the `/templates` page are returned. This is done with a new parameter so as not to break the V1 API. Although I looked in Kibana and it doesn’t seem like anyone external is using this endpoint we’ve come this far without breaking the API so…