Fixed bug in Admin page; Finished asset data entry page.

This commit is contained in:
2022-07-22 00:14:45 -07:00
parent 84e7dc890b
commit 195d93fd20
3 changed files with 34 additions and 13 deletions

View File

@@ -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 {