Ready to get started?
Join Adocasts Plus for $8/mo, or sign into an existing Adocasts Plus account, to get access to all of our lessons.
Building with AdonisJS & Inertia #9.2
Creating & Listing Sortable Course Lessons
We'll add the ability to create new lessons within a course's module. We'll then list the lessons within their designated module using the order specified by the user.
- Created by
- @tomgobich
- Published
Join the Discussion 4 comments
-
The line
statusId: props.organization.statuses.at(0)?.id
works fine in my SortableModules, but in the SortableLessons, it is breaking the page due to 'Cannot read properties of undefined (reading 'statuses').' I have looked through all the files I thought could be related, but haven't found any differences. Any suggestions on what could be causing it?
1-
Responding to aaron-ford
Hi Aaron!
It sounds like your
organizationis undefined within theSortableLessonscomponent. If it works fine withinSortableModulesthen it should be populated on the page okay. Make sure you've got it within the props being passed intoSortableLessons!<SortableLessons v-model="modules[index]" :organization="organization" <!-- 👈 --> :course="course" />Copied!If it's there, then make sure it is within
SortableLessonsprops.const props = defineProps<{ organization: Organization // 👈 course: CourseDto modelValue: ModuleDto }>()Copied!I'd reckon it's one of those two, but if it is in both of those spots, I'd recommend using the Vue DevTools to inspect the flow of this prop to see where it might be getting lost.
Hope this helps!!
0-
Responding to tomgobich
Thanks! I found it. A typo… was missing the in organization. That's why you don't code late at night.
1-
Responding to aaron-ford
Anytime! Awesome, I'm glad to hear you were able to get it fixed up! As a morning person, I can concur! 😄
0
-
-
-