mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
fix: updated names in methods.ts
This commit is contained in:
@@ -1,25 +1,26 @@
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { $$UpperName$$Type, $$UpperName$$Collection } from './collection';
|
||||
import { Mongo } from 'meteor/mongo';
|
||||
import { $$UpperName$$, $$UpperName$$Collection } from './collection';
|
||||
|
||||
export function create$$UpperName$$(data: $$UpperName$$Type) {
|
||||
export function create(data: $$UpperName$$) {
|
||||
return $$UpperName$$Collection.insertAsync({ ...data });
|
||||
}
|
||||
|
||||
export function update$$UpperName$$(_id: string, data: Partial<$$UpperName$$Type>) {
|
||||
export function update(_id: string, data: Mongo.Modifier<$$UpperName$$>) {
|
||||
return $$UpperName$$Collection.updateAsync(_id, { ...data });
|
||||
}
|
||||
|
||||
export function remove$$UpperName$$(_id: string) {
|
||||
export function remove(_id: string) {
|
||||
return $$UpperName$$Collection.removeAsync(_id);
|
||||
}
|
||||
|
||||
export function find$$UpperName$$ById(_id: string) {
|
||||
export function findById(_id: string) {
|
||||
return $$UpperName$$Collection.findOneAsync(_id);
|
||||
}
|
||||
|
||||
Meteor.methods({
|
||||
'$$UpperName$$.create': create$$UpperName$$,
|
||||
'$$UpperName$$.update': update$$UpperName$$,
|
||||
'$$UpperName$$.remove': remove$$UpperName$$,
|
||||
'$$UpperName$$.find': find$$UpperName$$ById
|
||||
'$$UpperName$$.create': create,
|
||||
'$$UpperName$$.update': update,
|
||||
'$$UpperName$$.remove': remove,
|
||||
'$$UpperName$$.find': findById
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user