Just changes.
This commit is contained in:
parent
5ba618f471
commit
8bd3fb1853
8 changed files with 214 additions and 13 deletions
|
|
@ -20,11 +20,11 @@ Meteor.methods({
|
|||
throw new Meteor.Error('You are not allowed to add location types. Make sure you are logged in with valid user credentials.');
|
||||
}
|
||||
|
||||
return await LocationTypes.insertAsync({
|
||||
locationTypeName: typeName,
|
||||
locationTypeDesc: typeDesc,
|
||||
dateAdded: new Date(),
|
||||
addedBy: this.userId,
|
||||
});
|
||||
return await LocationTypes.insertAsync({
|
||||
locationTypeName: typeName,
|
||||
locationTypeDesc: typeDesc,
|
||||
dateAdded: new Date(),
|
||||
addedBy: this.userId,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -12,5 +12,29 @@ Locations.allow({
|
|||
});
|
||||
|
||||
Meteor.methods({
|
||||
async 'add.location' (locName, locDesc, locTypeName, locTypeId, isChild, parentName, parentId) {
|
||||
check(locName, String);
|
||||
check(locDesc, String);
|
||||
check(locTypeName, String);
|
||||
check(locTypeId, String);
|
||||
check(isChild, Boolean);
|
||||
check(parentName, String);
|
||||
check(parentId, String);
|
||||
|
||||
if (!this.userId) {
|
||||
throw new Meteor.Error('You are not allowed to add locations. Make sure you are logged in with valid user credentials.');
|
||||
}
|
||||
|
||||
return await Locations.insertAsync({
|
||||
locationName: locName,
|
||||
locationDesc: locDesc,
|
||||
locationTypeName: locTypeName,
|
||||
locationTypeId: locTypeId,
|
||||
isChild: isChild,
|
||||
parentName: parentName,
|
||||
parentId: parentId,
|
||||
addedOn: new Date(),
|
||||
addedBy: this.userId,
|
||||
});
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue