I've got the course structure all sorted out, but I'm struggling to understand how to retrieve a lesson object by its ID and also update a lesson object with new property values.
If anyone could provide some guidance on the right approach, it would be greatly appreciated.
{
id: 1,
name: 'A Fantastic Course',
description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla porttitor lorem vel turpis congue euismod.',
sections: [
{
id: 1,
sort_order: 1,
name: 'Section one',
lessons: [
{
id: 1,
sort_order: 1,
name: 'Lesson One'
},
{
id: 3,
sort_order: 2,
name: 'Lesson Three'
},
{
id: 2,
sort_order: 3,
name: 'Lesson Two'
}
]
},
{
id: 2,
sort_order: 2,
name: 'Section Two',
lessons: [
{
id: 4,
sort_order: 1,
name: 'Lesson Four'
},
{
id: 5,
sort_order: 2,
name: 'Lesson Five'
},
{
id: 6,
sort_order: 3,
name: 'Lesson Six'
}
]
}
]
}