mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 18:11:40 -05:00
30 lines
668 B
JavaScript
30 lines
668 B
JavaScript
import Posts from "meteor/vulcan:posts";
|
|
import { getCategoriesAsOptions } from './schema.js';
|
|
|
|
Posts.addField([
|
|
{
|
|
fieldName: 'categories',
|
|
fieldSchema: {
|
|
type: Array,
|
|
control: "checkboxgroup",
|
|
optional: true,
|
|
insertableBy: ['members'],
|
|
editableBy: ['members'],
|
|
viewableBy: ['guests'],
|
|
form: {
|
|
noselect: true,
|
|
type: "bootstrap-category",
|
|
order: 50,
|
|
options: formProps => getCategoriesAsOptions(formProps.client),
|
|
},
|
|
resolveAs: 'categories: [Category]'
|
|
}
|
|
},
|
|
{
|
|
fieldName: 'categories.$',
|
|
fieldSchema: {
|
|
type: String,
|
|
optional: true
|
|
}
|
|
}
|
|
]);
|