my component is fetching query result from class and showing in Aura App console but doesn't work in LWC experience builder. I tried running it on load and through button click also, it doesn't give any result, array shows blank, length 0. I tested in anonymous window this query fetches result. I don't know what I'm missing. Please guide.
import { LightningElement, track,api, wire } from 'lwc';
import getNotes from '@salesforce/apex/TBT_SupervisorNotes.getNotes';
export default class tBT_SessionGuideline extends LightningElement {
@wire(getNotes) gnotes;
@track getNotes;
@track datalist = [];
connectedCallback(){
getNotes().then(res => {
this.datalist = res;
console.log('hi');
console.log("result from connected callback", res);
console.log("datalist result from connected callback", this.datalist);
}).catch((error)=>{
console.error("error " ,JSON.stringify(error));
})
}
Apex class
public class TBT_supervisorNotes {
@AuraEnabled(Cacheable=true)
public static List<Input_Form__c> getNotes(){
List<Input_Form__c> LognotesList = [ select id, Session_Summary__c from input_form__c where recordtype.name = 'TBT Supervisor Log Notes' ];
system.debug(LognotesList);
return LognotesList;
}
}