-
Notifications
You must be signed in to change notification settings - Fork 0
/
mantra_cli.yaml
39 lines (31 loc) · 1.09 KB
/
mantra_cli.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
tabSize: 2
templates:
- name: 'method'
text: |
import {Meteor} from 'meteor/meteor';
import {ValidatedMethod} from 'meteor/mdg:validated-method';
import {SimpleSchema} from 'meteor/aldeed:simple-schema';
import {<%= methodFileName %>} from '/lib/collections';
export default function () {
return {
// nazev metody ktery pouzivame pri volani po importu
create: new ValidatedMethod({
// nazev, ktery volame pri Meteor.call()
name: '<%= methodFileName %>.create',
// validace vstupnich promennych
validate: new SimpleSchema({
title: { type: String }
}).validator(),
applyOptions: {
noRetry: true,
},
// hlavni kod
run({title}) {
// na tomto miste overime opravneni uzivatele
// prihlaseni konkretniho uzivatele a jeho pusobnost v patricne roli
throw new Meteor.Error('xxx', 'popis');
console.log(title);
},
})
};
}