feat: various improvements

wip: frontend

feat: enable cascade on foreign keys

wip1

wip2

fix chapters issues

wip4
This commit is contained in:
swve 2023-11-29 22:29:48 +01:00
parent 2bf80030d7
commit 187f75e583
71 changed files with 879 additions and 568 deletions

View file

@ -25,18 +25,16 @@ function Chapter(props: any) {
setSelectedChapter(undefined);
let modifiedChapterCopy = {
name: modifiedChapter.chapterName,
description: '',
activities: props.info.list.chapter.activityIds,
}
await updateChapter(chapterId, modifiedChapterCopy)
await mutate(`${getAPIUrl()}chapters/meta/course_${props.courseid}`)
await mutate(`${getAPIUrl()}chapters/course/${props.course_uuid}/meta`)
await revalidateTags(['courses'], props.orgslug)
router.refresh();
}
}
return (
<Draggable key={props.info.list.chapter.id} draggableId={props.info.list.chapter.id} index={props.index}>
<Draggable key={props.info.list.chapter.uuid} draggableId={String(props.info.list.chapter.uuid)} index={props.index}>
{(provided, snapshot) => (
<ChapterWrapper
{...provided.dragHandleProps}
@ -81,7 +79,7 @@ function Chapter(props: any) {
></ConfirmationModal>
</div>
<Droppable key={props.info.list.chapter.id} droppableId={props.info.list.chapter.id} type="activity">
<Droppable key={props.info.list.chapter.id} droppableId={String(props.info.list.chapter.id)} type="activity">
{(provided) => (
<ActivitiesList {...provided.droppableProps} ref={provided.innerRef}>
<div className="flex flex-col">