Applied style rules to genocide all \t characters
This commit is contained in:
@@ -1,31 +1,31 @@
|
||||
import { ValidatedMethod } from 'meteor/mdg:validated-method';
|
||||
import { RateLimiterMixin } from 'ddp-rate-limiter-mixin';
|
||||
import Libraries, {removeLibaryWork} from '/imports/api/library/Libraries.js';
|
||||
import Libraries, { removeLibaryWork } from '/imports/api/library/Libraries.js';
|
||||
import Creatures from '/imports/api/creature/creatures/Creatures.js';
|
||||
import {removeCreatureWork} from '/imports/api/creature/creatures/methods/removeCreature.js';
|
||||
import { removeCreatureWork } from '/imports/api/creature/creatures/methods/removeCreature.js';
|
||||
|
||||
Meteor.users.deleteMyAccount = new ValidatedMethod({
|
||||
name: 'users.deleteMyAccount',
|
||||
validate: null,
|
||||
name: 'users.deleteMyAccount',
|
||||
validate: null,
|
||||
mixins: [RateLimiterMixin],
|
||||
rateLimit: {
|
||||
numRequests: 1,
|
||||
timeInterval: 5000,
|
||||
},
|
||||
run(){
|
||||
run() {
|
||||
let userId = Meteor.userId();
|
||||
if (!userId) throw new Meteor.Error('No user',
|
||||
'You must be logged in to delete your account');
|
||||
|
||||
// Delete all creatures
|
||||
let creatures = Creatures.find({owner: userId}, {fields: {_id: 1}}).fetch();
|
||||
let creatures = Creatures.find({ owner: userId }, { fields: { _id: 1 } }).fetch();
|
||||
creatures.forEach(creature => removeCreatureWork(creature._id));
|
||||
|
||||
// Remove permissions from all creatures
|
||||
Creatures.update({
|
||||
$or: [
|
||||
{writers: userId},
|
||||
{readers: userId},
|
||||
{ writers: userId },
|
||||
{ readers: userId },
|
||||
],
|
||||
}, {
|
||||
$pull: {
|
||||
@@ -37,14 +37,14 @@ Meteor.users.deleteMyAccount = new ValidatedMethod({
|
||||
});
|
||||
|
||||
// Delete all libraries
|
||||
let libraries = Libraries.find({owner: userId}, {fields: {_id: 1}}).fetch();
|
||||
let libraries = Libraries.find({ owner: userId }, { fields: { _id: 1 } }).fetch();
|
||||
libraries.forEach(library => removeLibaryWork(library._id));
|
||||
|
||||
// Remove permissions from all creatures
|
||||
Libraries.update({
|
||||
$or: [
|
||||
{writers: userId},
|
||||
{readers: userId},
|
||||
{ writers: userId },
|
||||
{ readers: userId },
|
||||
],
|
||||
}, {
|
||||
$pull: {
|
||||
@@ -57,5 +57,5 @@ Meteor.users.deleteMyAccount = new ValidatedMethod({
|
||||
|
||||
// delete the account
|
||||
Meteor.users.remove(userId);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user