apstanisic / zmaj

Zmaj is a headless CMS for managing database
https://zmaj.vercel.app
MIT License
5 stars 0 forks source link

Do not keep both fields and full fields in full collection #38

Closed apstanisic closed 1 year ago

apstanisic commented 1 year ago

It just takes space, and it makes it error prone to only change in one place. There are 3 ways to get field from collection: col.properties.fieldName, col.fields.find(), col.fullFields.find(). That is error prone, cause it's easy to update some data, but not in all places.

Maybe

const col = {
  fields: {fieldName: {}},
  relations: {relName: {}},
}