Added schema defaults to all schemas to prevent strings from being trimmed
This commit is contained in:
18
app/imports/api/schema.js
Normal file
18
app/imports/api/schema.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import SimpleSchema from 'simpl-schema';
|
||||
|
||||
function getDefaultSchema(){
|
||||
return new SimpleSchema({}, {
|
||||
clean: {
|
||||
filter: true,
|
||||
autoConvert: true,
|
||||
removeEmptyStrings: true,
|
||||
trimStrings: false,
|
||||
getAutoValues: true,
|
||||
removeNullsFromArrays: true,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
export default function schema(options){
|
||||
return getDefaultSchema().extend(options);
|
||||
}
|
||||
Reference in New Issue
Block a user