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();
|
||||
|
||||
// refresh page (FIX for Next.js BUG)
|
||||
window.location.reload();
|
||||
//window.location.reload();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ const CourseClient = (props: any) => {
|
|||
router.refresh();
|
||||
|
||||
// refresh page (FIX for Next.js BUG)
|
||||
window.location.reload();
|
||||
// window.location.reload();
|
||||
}
|
||||
|
||||
async function quitCourse() {
|
||||
|
|
@ -38,7 +38,7 @@ const CourseClient = (props: any) => {
|
|||
router.refresh();
|
||||
|
||||
// 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 { Folders, Package2, SaveIcon } from "lucide-react";
|
||||
import GeneralWrapperStyled from "@components/StyledElements/Wrappers/GeneralWrapper";
|
||||
import { revalidateTags } from "@services/utils/ts/requests";
|
||||
|
||||
function CourseEdit(params: any) {
|
||||
|
||||
|
|
@ -75,6 +76,8 @@ function CourseEdit(params: any) {
|
|||
const submitChapter = async (chapter: any) => {
|
||||
await createChapter(chapter, courseid);
|
||||
await getCourseChapters();
|
||||
revalidateTags(['courses'], orgslug);
|
||||
router.refresh();
|
||||
setNewChapterModal(false);
|
||||
};
|
||||
|
||||
|
|
@ -86,6 +89,8 @@ function CourseEdit(params: any) {
|
|||
await createActivity(activity, activity.chapterId, org.org_id);
|
||||
await getCourseChapters();
|
||||
setNewActivityModal(false);
|
||||
revalidateTags(['courses'], orgslug);
|
||||
router.refresh();
|
||||
};
|
||||
|
||||
// Submit File Upload
|
||||
|
|
@ -94,6 +99,8 @@ function CourseEdit(params: any) {
|
|||
await createFileActivity(file, type, activity, chapterId);
|
||||
await getCourseChapters();
|
||||
setNewActivityModal(false);
|
||||
revalidateTags(['courses'], orgslug);
|
||||
router.refresh();
|
||||
};
|
||||
|
||||
// Submit YouTube Video Upload
|
||||
|
|
@ -103,17 +110,23 @@ function CourseEdit(params: any) {
|
|||
await createExternalVideoActivity(external_video_data, activity, chapterId);
|
||||
await getCourseChapters();
|
||||
setNewActivityModal(false);
|
||||
revalidateTags(['courses'], orgslug);
|
||||
router.refresh();
|
||||
};
|
||||
|
||||
const deleteChapterUI = async (chapterId: any) => {
|
||||
console.log("deleteChapter", chapterId);
|
||||
await deleteChapter(chapterId);
|
||||
getCourseChapters();
|
||||
revalidateTags(['courses'], orgslug);
|
||||
router.refresh();
|
||||
};
|
||||
|
||||
const updateChapters = () => {
|
||||
console.log(data);
|
||||
updateChaptersMetadata(courseid, data);
|
||||
revalidateTags(['courses'], orgslug);
|
||||
router.refresh();
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -49,9 +49,10 @@ function CreateCourseModal({ closeModal, orgslug }: any) {
|
|||
if (status.org_id == orgId) {
|
||||
closeModal();
|
||||
router.refresh();
|
||||
revalidateTags(['courses'], orgslug);
|
||||
|
||||
// refresh page (FIX for Next.js BUG)
|
||||
window.location.reload();
|
||||
// window.location.reload();
|
||||
} else {
|
||||
alert("Error creating course, please see console logs");
|
||||
console.log(status);
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@ export const AuthenticatedClientElement = (props: AuthenticatedClientElementProp
|
|||
|
||||
// Available roles
|
||||
const org_roles_values = ["admin", "owner"];
|
||||
const user_roles_values = ["role_admin"];
|
||||
const user_roles_values = ["role_admin", "role_super_admin"];
|
||||
|
||||
|
||||
|
||||
|
||||
function checkRoles() {
|
||||
const org_id = props.orgId;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue