Address review comments

This commit is contained in:
Drew Gross
2016-02-05 18:53:06 -08:00
parent e2e0a26e9a
commit a5440bcc40
2 changed files with 6 additions and 5 deletions

View File

@@ -32,10 +32,10 @@ function mongoFieldTypeToSchemaAPIType(type) {
function mongoSchemaAPIResponseFields(schema) {
fieldNames = Object.keys(schema).filter(key => key !== '_id');
response = {};
fieldNames.forEach(fieldName => {
response[fieldName] = mongoFieldTypeToSchemaAPIType(schema[fieldName]);
});
response = fieldNames.reduce((obj, fieldName) => {
obj[fieldName] = mongoFieldTypeToSchemaAPIType(schema[fieldName])
return obj;
}, {});
response.ACL = {type: 'ACL'};
response.createdAt = {type: 'Date'};
response.updatedAt = {type: 'Date'};