removes leftover autopopulate in schema construction

This commit is contained in:
James
2020-11-04 09:05:54 -05:00
parent 90bac7f4ab
commit 0ffbd2ee0f

View File

@@ -113,7 +113,6 @@ const fieldToSchemaMap = {
[field.name]: {
...formatBaseSchema(field),
type: Schema.Types.ObjectId,
autopopulate: true,
ref: field.relationTo,
},
}),
@@ -123,7 +122,6 @@ const fieldToSchemaMap = {
if (Array.isArray(field.relationTo)) {
schema.value = {
type: Schema.Types.ObjectId,
autopopulate: true,
refPath: `${field.name}${field.localized ? '.{{LOCALE}}' : ''}.relationTo`,
};
schema.relationTo = { type: String, enum: field.relationTo };
@@ -133,7 +131,6 @@ const fieldToSchemaMap = {
};
schema.type = Schema.Types.ObjectId;
schema.autopopulate = true;
schema.ref = field.relationTo;
}