mirror of
https://github.com/vale981/Vulcan
synced 2025-03-07 02:21:43 -05:00
56 lines
No EOL
1,010 B
JavaScript
56 lines
No EOL
1,010 B
JavaScript
Users.addField({
|
||
fieldName: 'telescope.isDummy',
|
||
fieldSchema: {
|
||
type: Boolean,
|
||
optional: true,
|
||
autoform: {
|
||
omit: true
|
||
}
|
||
}
|
||
});
|
||
|
||
Posts.addField({
|
||
fieldName: 'dummySlug',
|
||
fieldSchema: {
|
||
type: String,
|
||
optional: true,
|
||
autoform: {
|
||
omit: true
|
||
}
|
||
}
|
||
});
|
||
|
||
Posts.addField({
|
||
fieldName: 'isDummy',
|
||
fieldSchema: {
|
||
type: Boolean,
|
||
optional: true,
|
||
autoform: {
|
||
omit: true
|
||
}
|
||
}
|
||
});
|
||
|
||
Comments.addField({
|
||
fieldName: 'isDummy',
|
||
fieldSchema: {
|
||
type: Boolean,
|
||
optional: true,
|
||
autoform: {
|
||
omit: true
|
||
}
|
||
}
|
||
});
|
||
|
||
/**
|
||
* @summary Copy over profile.isDummy to telescope.isDummy on user creation
|
||
* @param {Object} user – the user object being iterated on and returned
|
||
* @param {Object} options – user options
|
||
*/
|
||
function copyDummyProperty (user, options) {
|
||
if (typeof user.profile.isDummy !== "undefined") {
|
||
user.telescope.isDummy = user.profile.isDummy;
|
||
}
|
||
return user;
|
||
}
|
||
Telescope.callbacks.add("onCreateUser", copyDummyProperty); |