mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 08:18:50 +00:00
25 lines
537 B
JavaScript
25 lines
537 B
JavaScript
|
|
import { Meteor } from 'meteor/meteor';
|
||
|
|
import { Mongo } from 'meteor/mongo';
|
||
|
|
import { check } from 'meteor/check';
|
||
|
|
|
||
|
|
export const MScripts = new Mongo.Collection('mScripts');
|
||
|
|
|
||
|
|
MScripts.allow({
|
||
|
|
insert: function(userId, doc){
|
||
|
|
// if use id exists, allow insert
|
||
|
|
return !!userId;
|
||
|
|
},
|
||
|
|
});
|
||
|
|
|
||
|
|
Meteor.methods({
|
||
|
|
'set.ScriptRun' (scriptName) {
|
||
|
|
check(scriptName, String);
|
||
|
|
|
||
|
|
MScripts.insert({
|
||
|
|
scriptName: scriptName,
|
||
|
|
hasRun: true,
|
||
|
|
runOn: new Date(),
|
||
|
|
});
|
||
|
|
},
|
||
|
|
});
|