Moved tabletop characters to left side of the screen
This commit is contained in:
@@ -2,7 +2,6 @@ import SimpleSchema from 'simpl-schema';
|
||||
import { ValidatedMethod } from 'meteor/mdg:validated-method';
|
||||
import { RateLimiterMixin } from 'ddp-rate-limiter-mixin';
|
||||
import { assertUserInTabletop } from './shared/tabletopPermissions';
|
||||
import { assertAdmin } from '/imports/api/sharing/sharingPermissions';
|
||||
import { assertUserHasPaidBenefits } from '/imports/api/users/patreon/tiers';
|
||||
import Creatures from '/imports/api/creature/creatures/Creatures';
|
||||
|
||||
@@ -16,15 +15,16 @@ const addCreaturesToTabletop = new ValidatedMethod({
|
||||
},
|
||||
'creatureIds.$': {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.id,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
},
|
||||
tabletopId: {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.id,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
},
|
||||
}).validator(),
|
||||
|
||||
mixins: [RateLimiterMixin],
|
||||
// @ts-expect-error Rate limit not defined
|
||||
rateLimit: {
|
||||
numRequests: 10,
|
||||
timeInterval: 5000,
|
||||
@@ -37,16 +37,16 @@ const addCreaturesToTabletop = new ValidatedMethod({
|
||||
}
|
||||
assertUserHasPaidBenefits(this.userId);
|
||||
assertUserInTabletop(tabletopId, this.userId);
|
||||
assertAdmin(this.userId);
|
||||
|
||||
Creatures.update({
|
||||
_id: { $in: creatureIds },
|
||||
// You must have write permission for the creatures you
|
||||
$or: [
|
||||
{ writers: this.userId },
|
||||
{ owner: this.userId },
|
||||
],
|
||||
}, {
|
||||
$set: { tabletop: tabletopId },
|
||||
$set: { tabletopId },
|
||||
}, {
|
||||
multi: true,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user