More details in model and API.
This is a bit bigger merge. It updates the db model and api to handle more details about initiatives and streamlines things a bit.
The details additionally handled are:
- Contact details (phone, mail, social media, …)
- all image sizes
- short description
On the way, a few other things were improved/changed:
- All localized content is now in one table (InitiativeTranslations) instead of InitiativeTitleText and InitiativeDescription.
- When querying initiatives, the tags field only contain slugs, not a full tag object with linked initiatives again.
- Responses are zipped for size.
- Use slugs instead of ids whereever possible.
These changes need to be reflect on several layers:
- DB is adapted. Obviously.
- Appropriate DB migrations created. At this stage, we could have ignored this, but now I know how to do this.
- import script from SK3.
- DB serializers for API. This changes the data structure given out. Particularly, initiatives don't contain the full linked tags any longer.
- React frontend. Needed to be adapted to the new API. At many places, a additional query for tags became necessary. I refactored the code towards putting everything API-related into one module making the other parts (hopefully) more stable against API changes.
fixes #91 (closed), #132 (closed)
Further notes:
- Turns out addresses<->initiatives are N<->M in SK3, but 1<->N in SK4, so the import was a bit broken