You need to sign in to do that
Don't have an account?
Wire not calling the Apex controller
I’m using @wire to get the getMenuStructure from es_get_Menu_Items,
When I call es_get_Menu_Items. getMenuStructure( 'a0u0C000009cXeIQAU')
from a debug window it returns a list
When I call it from an aura component I get data,
its the wire that’s not working, rather than the apex code
when I run the below it returns undefined.
Can you see what I am doing wrong ?
/*JS*/
import { LightningElement, api, wire, track } from 'lwc';
import getMenuStructure from '@salesforce/apex/es_get_Menu_Items.getMenuStructure';
export default class ChildComponent extends LightningElement {
@api authStatuses;
@api error;
@wire(getMenuStructure , {questionsetUserId: 'a0u0C000009cXeIQAU'})
getMenuStructure({data,error}){
alert('success ' + data);
if (data) {
this.menuStructure = data;
this.error = undefined;
} else if (error) {
this.error = error;
this.menuStructure= undefined;
}
};
}