webiny / webiny-js

Open-source serverless enterprise CMS. Includes a headless CMS, page builder, form builder, and file manager. Easy to customize and expand. Deploys to AWS.
https://www.webiny.com
Other
7.29k stars 601 forks source link

fix(api-headless-cms): gracefully fall back to applicable fields #4203

Closed Pavel910 closed 1 month ago

Pavel910 commented 1 month ago

Changes

This PR removes throwing of errors when dealing with titleFieldId, descriptionFieldId, and imageFieldId in the CMS model editor. If an inapplicable field is sent to the API (which is not even possible through the UI, you can only do this via a programmatic API call), the API will no longer throw errors. Instead, it will gracefully fall back to the applicable fields, if possible. Otherwise, the field roles will simply be set to: id for titleFieldId, and null for descriptionFieldId and imageFieldId.

How Has This Been Tested?