I have this course structure in hand, but I am not able to figure out how I can fetch a lesson object by ID and as well as how I can update a lesson object with modified property values?
If anyone could shine some light to the right path will be much appreciated.
{
id: 1,
name: 'An Amazing Course',
description: 'Mauris ac efficitur enim, nec commodo quam. Nunc vehicula blandit porta.',
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'
}
]
}
]
}