Skip to content

fix(renderField): use field.localized #35

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zernie
Copy link
Contributor

@zernie zernie commented Jun 3, 2020

There is a bug in the --localization flag - it does not take field.localized into consideration.


This change is Reviewable

@zernie zernie force-pushed the fix/localization-flag branch from 753506f to 5e9c36b Compare June 3, 2020 11:18
@@ -3,7 +3,8 @@ export default function renderLocalizedTypes(localization: boolean) {
if (!localization) return null

return `
export type LocalizedField<T> = Partial<Record<LOCALE_CODE, T>>
export type DefaultLocalizedField<T> = Record<CONTENTFUL_DEFAULT_LOCALE_CODE, T>
Copy link
Contributor Author

@zernie zernie Jun 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we're using locale=* even non-localized fields will be rendered as


"field": {
   "<CONTENTFUL_DEFAULT_LOCALE_CODE>": "value"
},

@zernie
Copy link
Contributor Author

zernie commented Aug 25, 2020

hey @stevenpetryk, could you please take a look?

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

Successfully merging this pull request may close these issues.

2 participants