Fixed bug in Admin page; Finished asset data entry page.
This commit is contained in:
@@ -57,8 +57,12 @@ Meteor.methods({
|
||||
|
||||
if(Roles.userIsInRole(Meteor.userId(), "admin", {anyScope:true})) {
|
||||
let assetType = AssetTypes.findOne({assetTypeId});
|
||||
|
||||
if(serial) {
|
||||
|
||||
if(Assets.findOne({assetId})) {
|
||||
//return {error: true, errorType: 'duplicateAssetId'}
|
||||
throw new Meteor.Error("duplicateAssetId", "Cannot use the same asset ID twice.")
|
||||
}
|
||||
else if(serial) {
|
||||
Assets.insert({assetTypeId, assetId, serial});
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user