Improved handling of character avatars, added portraits

This commit is contained in:
Thaum Rystra
2020-05-16 13:40:54 +02:00
parent d59d8cb54f
commit acb9dc342a
8 changed files with 55 additions and 7 deletions

View File

@@ -47,6 +47,10 @@ let CreatureSchema = new SimpleSchema({
type: String,
optional: true
},
avatarPicture: {
type: String,
optional: true,
},
// Mechanics
deathSave: {
@@ -120,7 +124,7 @@ const updateCreature = new ValidatedMethod({
validate({_id, path}){
if (!_id) return false;
// Allowed fields
let allowedFields = ['name', 'alignment', 'gender', 'picture', 'settings'];
let allowedFields = ['name', 'alignment', 'gender', 'picture', 'avatarPicture', 'settings'];
if (!allowedFields.includes(path[0])){
throw new Meteor.Error('Creatures.methods.update.denied',
'This field can\'t be updated using this method');