Open ahmadsholehin opened 8 years ago
The "updatedBy" attribute does not autofill when doing SomeSchema.clean( obj ) at the server.
// in model definition SomeSchema = new SimpleSchema( { updatedBy: orion.attribute('updatedBy'), createdBy: orion.attribute('createdBy') } ); // in a method var obj = {}; SomeSchema.clean( obj, { extendAutoValueContext: { isInsert: true, isUpdate: false, isUpsert: false, isFromTrustedCode: true } } ); check( obj, SomeSchema ); // check will fail with updatedBy unfilled
Probably because it is not marked as optional, in comparison to createdBy's. See: https://github.com/orionjs/orion/blob/master/packages/attributes/updated-by/updated-by.js#L10 https://github.com/orionjs/orion/blob/master/packages/attributes/created-by/created-by.js#L10
Is there something that I've missed? Is this by design?
The "updatedBy" attribute does not autofill when doing SomeSchema.clean( obj ) at the server.
Probably because it is not marked as optional, in comparison to createdBy's. See: https://github.com/orionjs/orion/blob/master/packages/attributes/updated-by/updated-by.js#L10 https://github.com/orionjs/orion/blob/master/packages/attributes/created-by/created-by.js#L10
Is there something that I've missed? Is this by design?