Recovering preloaded data with adonisjs 5

16 views Asked by At

I've preloaded the data from my DB using my templates, but I can't manage to display them in the view

this is my function in my controller

async index({view, response}): Promise<HttpContextContract>{
    const data =  await Structure.query().preload('liste_carte')
    return view.render('pages/list-lot', {data})
}

when I do a console.log('data',data) in the 'list-lot' view I'm told that data is not defined

data

0

There are 0 answers