I am trying to pass an array of objects from LWC to Apex but getting the error "Attempt to de-reference a null onbject". I googled and tried every possible way, but nothing seems to be working. What am I doing wrong. Below is my basic code snippet.
Map in LWC --
lwcmap = [{"key":"1","value":"test1"},{"key":"2","value":"test2"},{"key":"3","value":"test3"}]
method in LWC calling apex --
updateLVFilterData({MapofLWC : this.lwcmap}).then(data => {
}
Apex controller --
@AuraEnabled
public static void mapofLWC( Map<Integer, String> MapofLWC){
system.debug('MapofLWC - '+MapofLWC);
}