mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
fix: more bugs
This commit is contained in:
parent
b069f1badf
commit
687f7b2116
5 changed files with 20 additions and 6 deletions
|
|
@ -107,7 +107,7 @@ export function MarkStatus(props: { activityid: string, course: any, orgslug: st
|
||||||
router.refresh();
|
router.refresh();
|
||||||
|
|
||||||
// refresh page (FIX for Next.js BUG)
|
// refresh page (FIX for Next.js BUG)
|
||||||
window.location.reload();
|
//window.location.reload();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ const CourseClient = (props: any) => {
|
||||||
router.refresh();
|
router.refresh();
|
||||||
|
|
||||||
// refresh page (FIX for Next.js BUG)
|
// refresh page (FIX for Next.js BUG)
|
||||||
window.location.reload();
|
// window.location.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function quitCourse() {
|
async function quitCourse() {
|
||||||
|
|
@ -38,7 +38,7 @@ const CourseClient = (props: any) => {
|
||||||
router.refresh();
|
router.refresh();
|
||||||
|
|
||||||
// refresh page (FIX for Next.js BUG)
|
// refresh page (FIX for Next.js BUG)
|
||||||
window.location.reload();
|
//window.location.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import Modal from "@components/StyledElements/Modal/Modal";
|
||||||
import { denyAccessToUser } from "@services/utils/react/middlewares/views";
|
import { denyAccessToUser } from "@services/utils/react/middlewares/views";
|
||||||
import { Folders, Package2, SaveIcon } from "lucide-react";
|
import { Folders, Package2, SaveIcon } from "lucide-react";
|
||||||
import GeneralWrapperStyled from "@components/StyledElements/Wrappers/GeneralWrapper";
|
import GeneralWrapperStyled from "@components/StyledElements/Wrappers/GeneralWrapper";
|
||||||
|
import { revalidateTags } from "@services/utils/ts/requests";
|
||||||
|
|
||||||
function CourseEdit(params: any) {
|
function CourseEdit(params: any) {
|
||||||
|
|
||||||
|
|
@ -75,6 +76,8 @@ function CourseEdit(params: any) {
|
||||||
const submitChapter = async (chapter: any) => {
|
const submitChapter = async (chapter: any) => {
|
||||||
await createChapter(chapter, courseid);
|
await createChapter(chapter, courseid);
|
||||||
await getCourseChapters();
|
await getCourseChapters();
|
||||||
|
revalidateTags(['courses'], orgslug);
|
||||||
|
router.refresh();
|
||||||
setNewChapterModal(false);
|
setNewChapterModal(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -86,6 +89,8 @@ function CourseEdit(params: any) {
|
||||||
await createActivity(activity, activity.chapterId, org.org_id);
|
await createActivity(activity, activity.chapterId, org.org_id);
|
||||||
await getCourseChapters();
|
await getCourseChapters();
|
||||||
setNewActivityModal(false);
|
setNewActivityModal(false);
|
||||||
|
revalidateTags(['courses'], orgslug);
|
||||||
|
router.refresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
// Submit File Upload
|
// Submit File Upload
|
||||||
|
|
@ -94,6 +99,8 @@ function CourseEdit(params: any) {
|
||||||
await createFileActivity(file, type, activity, chapterId);
|
await createFileActivity(file, type, activity, chapterId);
|
||||||
await getCourseChapters();
|
await getCourseChapters();
|
||||||
setNewActivityModal(false);
|
setNewActivityModal(false);
|
||||||
|
revalidateTags(['courses'], orgslug);
|
||||||
|
router.refresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
// Submit YouTube Video Upload
|
// Submit YouTube Video Upload
|
||||||
|
|
@ -103,17 +110,23 @@ function CourseEdit(params: any) {
|
||||||
await createExternalVideoActivity(external_video_data, activity, chapterId);
|
await createExternalVideoActivity(external_video_data, activity, chapterId);
|
||||||
await getCourseChapters();
|
await getCourseChapters();
|
||||||
setNewActivityModal(false);
|
setNewActivityModal(false);
|
||||||
|
revalidateTags(['courses'], orgslug);
|
||||||
|
router.refresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
const deleteChapterUI = async (chapterId: any) => {
|
const deleteChapterUI = async (chapterId: any) => {
|
||||||
console.log("deleteChapter", chapterId);
|
console.log("deleteChapter", chapterId);
|
||||||
await deleteChapter(chapterId);
|
await deleteChapter(chapterId);
|
||||||
getCourseChapters();
|
getCourseChapters();
|
||||||
|
revalidateTags(['courses'], orgslug);
|
||||||
|
router.refresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateChapters = () => {
|
const updateChapters = () => {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
updateChaptersMetadata(courseid, data);
|
updateChaptersMetadata(courseid, data);
|
||||||
|
revalidateTags(['courses'], orgslug);
|
||||||
|
router.refresh();
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -49,9 +49,10 @@ function CreateCourseModal({ closeModal, orgslug }: any) {
|
||||||
if (status.org_id == orgId) {
|
if (status.org_id == orgId) {
|
||||||
closeModal();
|
closeModal();
|
||||||
router.refresh();
|
router.refresh();
|
||||||
|
revalidateTags(['courses'], orgslug);
|
||||||
|
|
||||||
// refresh page (FIX for Next.js BUG)
|
// refresh page (FIX for Next.js BUG)
|
||||||
window.location.reload();
|
// window.location.reload();
|
||||||
} else {
|
} else {
|
||||||
alert("Error creating course, please see console logs");
|
alert("Error creating course, please see console logs");
|
||||||
console.log(status);
|
console.log(status);
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ export const AuthenticatedClientElement = (props: AuthenticatedClientElementProp
|
||||||
|
|
||||||
// Available roles
|
// Available roles
|
||||||
const org_roles_values = ["admin", "owner"];
|
const org_roles_values = ["admin", "owner"];
|
||||||
const user_roles_values = ["role_admin"];
|
const user_roles_values = ["role_admin", "role_super_admin"];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue