Vulcan/packages/vulcan-cloudinary/lib/custom_fields.js

30 lines
512 B
JavaScript
Raw Normal View History

2017-03-23 16:27:59 +09:00
import Posts from "meteor/vulcan:posts";
2016-05-31 10:53:23 +09:00
Posts.addField([
{
2016-07-11 11:47:00 +09:00
fieldName: 'cloudinaryId',
2016-05-31 10:53:23 +09:00
fieldSchema: {
type: String,
optional: true,
viewableBy: ['guests'],
2016-05-31 10:53:23 +09:00
}
2016-07-11 11:47:00 +09:00
},
{
fieldName: 'cloudinaryUrls',
fieldSchema: {
type: Array,
blackbox: true,
optional: true,
viewableBy: ['guests'],
resolveAs: 'cloudinaryUrls: [JSON]',
2016-07-11 11:47:00 +09:00
}
},
{
fieldName: 'cloudinaryUrls.$',
fieldSchema: {
type: Object,
optional: true
}
2016-05-31 10:53:23 +09:00
}
]);