Skip to content

Commit

Permalink
fix: only localizes schema if both field and top-level config are ena…
Browse files Browse the repository at this point in the history
…bled
  • Loading branch information
jmikrut committed May 17, 2022
1 parent dd8c1d7 commit e1a5547
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mongoose/buildSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const formatBaseSchema = (field: NonPresentationalField, buildSchemaOptions: Bui
});

const localizeSchema = (field: NonPresentationalField, schema, locales) => {
if (field.localized) {
if (field.localized && Array.isArray(locales)) {
return {
type: locales.reduce((localeSchema, locale) => ({
...localeSchema,
Expand Down

0 comments on commit e1a5547

Please sign in to comment.