Skip to content

Commit f034211

Browse files
committed
ensure fields exists in schema
1 parent fbf12ee commit f034211

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/Controllers/SchemaController.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -874,12 +874,14 @@ export default class SchemaController {
874874
return (
875875
deletePromise // Delete Everything
876876
.then(() => this.reloadData({ clearCache: true })) // Reload our Schema, so we have all the new values
877-
.then(() => {
878-
const promises = insertedFields.map(fieldName => {
877+
.then(async () => {
878+
const results = [];
879+
for (let i = 0; i < insertedFields.length; i += 1) {
880+
const fieldName = insertedFields[i];
879881
const type = submittedFields[fieldName];
880-
return this.enforceFieldExists(className, fieldName, type);
881-
});
882-
return Promise.all(promises);
882+
results.push(await this.enforceFieldExists(className, fieldName, type));
883+
}
884+
return results;
883885
})
884886
.then(results => {
885887
enforceFields = results.filter(result => !!result);

0 commit comments

Comments
 (0)