Skip to content

Commit adecec7

Browse files
Improve stuff collection definition.
1 parent 26e4f3a commit adecec7

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

app/imports/api/stuff/stuff.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,19 @@ import { SimpleSchema } from 'meteor/aldeed:simple-schema';
33

44
/* eslint-disable object-shorthand */
55

6-
export const stuff = 'Stuff'; // avoid typos, this string occurs three times.
7-
export const Stuff = new Mongo.Collection(stuff);
6+
export const Stuff = new Mongo.Collection('Stuff');
87

98
/**
109
* Create the schema for Stuff
11-
* See: https://github.com/aldeed/meteor-autoform#common-questions
12-
* See: https://github.com/aldeed/meteor-autoform#affieldinput
1310
*/
14-
Stuff.attachSchema(new SimpleSchema({
11+
export const StuffSchema = new SimpleSchema({
1512
name: {
1613
label: 'Name',
1714
type: String,
1815
optional: false,
1916
max: 20,
2017
autoform: {
21-
group: stuff,
18+
group: 'Stuff',
2219
placeholder: 'Bicycle',
2320
},
2421
},
@@ -27,8 +24,10 @@ Stuff.attachSchema(new SimpleSchema({
2724
type: Number,
2825
optional: false,
2926
autoform: {
30-
group: stuff,
27+
group: 'Stuff',
3128
placeholder: '3',
3229
},
3330
},
34-
}));
31+
});
32+
33+
Stuff.attachSchema(StuffSchema);

0 commit comments

Comments
 (0)