Putting a capital letter on the front of any product added.

This commit is contained in:
Brian McGonagill 2024-08-18 10:12:43 -05:00
parent c41857ab3e
commit f02ea7d549

View file

@ -20,8 +20,10 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to add products. Make sure you are logged in with valid user credentials.');
}
let pname = prodName.charAt(0).toUpperCase() + prodName.slice(1);
return Products.insert({
prodName: prodName,
prodName: pname,
prodOwner: this.userId,
prodStore: prodStore,
});
@ -35,9 +37,11 @@ Meteor.methods({
throw new Meteor.Error('You are not allowed to edit products. Make sure you are logged in with valid user credentials.');
}
let pname = prodName.charAt(0).toUpperCase() + prodName.slice(1);
return Products.update({ _id: prodId }, {
$set: {
prodName: prodName,
prodName: pname,
prodStore: prodStore,
}
});