Hello, i try to update a Laws collection inside Meteor using a method.
I can’t seem to use the update method properly
The callback function
handleSubmit(e){
e.preventDefault();
const titleLoi=e.target.titleLoi.value;
const abstractLoi=e.target.abstractLoi.value;
if(titleLoi){
Meteor.call('laws.update', titleLoi, abstractLoi);
}
};
And the server side
'laws.update': function(titleLoi, abstractLoi){
return Laws.update ({
$set:{title:titleLoi, abstract:abstractLoi}
});
},
I try to update two fileds in the document.
Thank you for your help (very newbie question, sorry!)