I'm trying to receive some data on the frontend using this Apex class (see below). The returned data however is an empty error. I followed the official SF documentation, made everything public and decorated with @auraEnabled, but still no data. Am I missing something? Thanks in advance!
public with sharing class AFF_Score_class {
@AuraEnabled(cacheable=true)
public static list<Overview__c> bindScore(string accountId, string programQ){
string Account = accountId;
string Program = programQ;
return [
SELECT Id, Period__c, Name, Status__c, TotalEarned__c, EarnedThisYear__c
FROM overview__c
WHERE programme__c = :Program
AND account__c = :Account
];
}
This is the code in my js file:
@wire(bindScore) score({data, error}){
debugger;
if(data){
console.log ("yes data")
console.log (data)
}
else {
console.log ("no data")
}
XML:
<targetConfig targets="lightningCommunity__Default">
<property name="accountId" type="String" />
<property name="programQ" type="String" />
</targetConfig>