Removed all separate property collections to be replaced with a single "creature property" collection
This commit is contained in:
@@ -1,19 +1,8 @@
|
||||
import SimpleSchema from 'simpl-schema';
|
||||
import schema from '/imports/api/schema.js';
|
||||
import { PropertySchema } from '/imports/api/properties/Properties.js'
|
||||
import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX.js';
|
||||
|
||||
// Mixins
|
||||
import creaturePermissionMixin from '/imports/api/creature/mixins/creaturePermissionMixin.js';
|
||||
import { setDocToLastMixin } from '/imports/api/creature/mixins/setDocToLastMixin.js';
|
||||
import { setDocAncestryMixin, ensureAncestryContainsCharIdMixin } from '/imports/api/parenting/parenting.js';
|
||||
import simpleSchemaMixin from '/imports/api/creature/mixins/simpleSchemaMixin.js';
|
||||
import propagateInheritanceUpdateMixin from '/imports/api/creature/mixins/propagateInheritanceUpdateMixin.js';
|
||||
import updateSchemaMixin from '/imports/api/creature/mixins/updateSchemaMixin.js';
|
||||
|
||||
let ClassLevels = new Mongo.Collection("classLevels");
|
||||
|
||||
let ClassLevelSchema = schema({
|
||||
let ClassLevelSchema = new SimpleSchema({
|
||||
name: {
|
||||
type: String,
|
||||
optional: true,
|
||||
@@ -35,39 +24,4 @@ let ClassLevelSchema = schema({
|
||||
},
|
||||
});
|
||||
|
||||
ClassLevels.attachSchema(ClassLevelSchema);
|
||||
ClassLevels.attachSchema(PropertySchema);
|
||||
|
||||
// Todo ensure the class level is being parented to a compatible class, and that
|
||||
// previous level requirements are met
|
||||
const insertClassLevel = new ValidatedMethod({
|
||||
name: 'ClassLevels.methods.insert',
|
||||
mixins: [
|
||||
creaturePermissionMixin,
|
||||
setDocAncestryMixin,
|
||||
ensureAncestryContainsCharIdMixin,
|
||||
setDocToLastMixin,
|
||||
simpleSchemaMixin,
|
||||
],
|
||||
collection: ClassLevels,
|
||||
permission: 'edit',
|
||||
schema: ClassLevelSchema,
|
||||
run(classLevel) {
|
||||
return ClassLevels.insert(classLevel);
|
||||
},
|
||||
});
|
||||
|
||||
const updateClassLevel = new ValidatedMethod({
|
||||
name: 'ClassLevels.methods.update',
|
||||
mixins: [
|
||||
propagateInheritanceUpdateMixin,
|
||||
updateSchemaMixin,
|
||||
creaturePermissionMixin,
|
||||
],
|
||||
collection: ClassLevels,
|
||||
permission: 'edit',
|
||||
schema: ClassLevelSchema,
|
||||
});
|
||||
|
||||
export default ClassLevels;
|
||||
export { ClassLevelSchema, insertClassLevel, updateClassLevel };
|
||||
export { ClassLevelSchema };
|
||||
|
||||
Reference in New Issue
Block a user