Lessons order inside sections
Hi FluentCommunity team,
I have been looking for a way to change the lesson order, but I cannot find a simple solution.
At the moment, lessons are added in chronological order, with the oldest lesson at the top and the newest at the bottom. I understand that lessons can be reordered manually, but since we upload lessons programmatically, it would be very useful for us to have new lessons appear at the top of the list by default.
Is there a way to do this?
Thank you.
How are you creating them programatically?
Taylor DraysonΒ We do live lessons on Zoom, recorded file are saved to Bunny.net for storage and then we create lessons in FluentCommunity via n8n automation.
AIV srlΒ You can re-order via this endpoint:
PATCH admin/courses/{course_id}/sections/{section_id}/indexes
Content-Type: application/json
{
"indexes": {
"NEW_LESSON_ID": 0,
"EXISTING_LESSON_1_ID": 1,
"EXISTING_LESSON_2_ID": 2
}
}
You would need to send every lesson in the section with the updated priority
GET admin/courses/{course_id}/sections would return the lessons with nested sections.
Then you would set the ID with priority 0 being highest.
Taylor DraysonΒ Thanks for the direction. Mmm... maybe this seems to be a lot of work.
We have like 10 to 16 lessons a day, 5 days a week.
Its would be great if there a tiny setting on the backend. Shahjahan JewelΒ
Alessandro AIVΒ You can add it into your n8n automation, it should be able to do it for you.
Taylor DraysonΒ Of course. In this case I have to download the list of all lessons, and change the indexes id (in n8n). Maybe.
Alessandro AIVΒ yeah, a JavaScript module would be able to do it in a single step probably. Get ai to generate you some code given the input and output required
Taylor DraysonΒ Thank you so much! I have to dig in.