• Manisha Rani 18
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi Team,

I have a wrapper class in my apex controller.
 
global class variableDTO {
        @AuraEnabled
        public String bkImgURL { get; set; }
        @AuraEnabled
        public List<String> monthListBefore {get; set;}
}

And I am trying to to access the monthListBefore list in LWC. My code is below.
 
@track background; 
@track MonthList;

@wire(getAllDTOs) wrappers ({
        error,
        data
    }) {
        if(data) {
            this.objects = data;
            this.background = data[0].bkImgURL;
            this.MonthList = data[0].MonthListBefore;
            console.log(this.background );
            console.log(this.MonthList );
        

        } else {
            this.error = error;
        }
    }
Here I got value for this.background but I got undefined for this.MonthList. Is there anything wrong in my code?

I got value MonthListBefore in json when I debug.
"monthListBefore":[ 
"Avr",
"Mai",
"Jui",
"Jui",
"Aoû",
"Sep",
"Oct",
"Nov",
"Déc"
],

Thank you.