I have this code :
@AuraEnabled(cacheable=false)
public static Boolean upsertPassengerList(List<requestWrapper> requests){
List<cms_Passenger_list__c> passengerList = new List<cms_Passenger_list__c>();
for(requestWrapper r : requests){
cms_Passenger_list__c p = new cms_Passenger_list__c();
p.cms_Contact__c = r.contactId;
p.cms_Travel__c = r.travelId;
if(r.checked){
p.cms_Status__c = 'Show';
}else{
p.cms_Status__c = 'No Show';
}
passengerList.add(p);
}
upsert passengerList;
return true;
}
JS Code:
onSaveRecords(){
upsertPassengerList({'requests' : this.upsertObject}).then((res)=>{
console.log(res);
}).catch((err)=>{
console.log('error on save');
})
}
What am I missing? The method is getting called from an LWC and I can safely say that all the parameters are correct.