mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 00:08:49 +00:00
updating mScript file
This commit is contained in:
parent
6a771a6f11
commit
e10e234250
1 changed files with 24 additions and 0 deletions
24
imports/api/mScripts.js
Normal file
24
imports/api/mScripts.js
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
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(),
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
Loading…
Add table
Add a link
Reference in a new issue