Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent setting null on fields that were not touched #549

Open
faizanabidnaqvi opened this issue Sep 15, 2023 · 1 comment
Open

Prevent setting null on fields that were not touched #549

faizanabidnaqvi opened this issue Sep 15, 2023 · 1 comment

Comments

@faizanabidnaqvi
Copy link

Hi there

In firecms v2, I noticed that it sets all fields that were not touched (like strings that we didn't set for an entity) to null. Is there a way to prevent this? I could do this through a callback and set all fields to undefined but it will be nice if there was a way to do it using the schema. I could also define default values but that won't make sense for certain fields.

In v1, it didn't set any fields that we didn't touch which was ideal for our use case. Having default null values affects other clients that use the database for our case.

@faizanabidnaqvi
Copy link
Author

I saw another thread discussion regarding setting null values for non-required fields. I feel like non-required fields, if not set and if not touched at all, should not even be added to firestore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant