From c33b40b55ea40f7d53209db786f041e0aa7e6417 Mon Sep 17 00:00:00 2001 From: Alex Mickelson Date: Tue, 15 Jul 2025 11:19:03 -0600 Subject: [PATCH] config updates --- build.sh | 2 +- eslint.config.mjs | 6 +++++- .../[courseName]/modules/ExpandableModule.tsx | 20 +++++++++++++------ 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/build.sh b/build.sh index aa42297..892b14b 100755 --- a/build.sh +++ b/build.sh @@ -1,7 +1,7 @@ #!/bin/bash MAJOR_VERSION="2" -MINOR_VERSION="7" +MINOR_VERSION="8" VERSION="$MAJOR_VERSION.$MINOR_VERSION" TAG_FLAG=false diff --git a/eslint.config.mjs b/eslint.config.mjs index f0e8a93..69097f5 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -12,7 +12,11 @@ const compat = new FlatCompat({ const eslintConfig = [ ...compat.config({ extends: ["next/core-web-vitals", "next/typescript", "prettier"], - ignorePatterns: ["**/node_modules/**", "**/.next/**", "storage/**"], + ignores: [ + "**/node_modules/**", + "**/.next/**", + "storage/**" + ], rules: { "react-refresh/only-export-components": "off", // Disabled the rule "@typescript-eslint/no-unused-vars": [ diff --git a/src/app/course/[courseName]/modules/ExpandableModule.tsx b/src/app/course/[courseName]/modules/ExpandableModule.tsx index a9277e4..64afe9c 100644 --- a/src/app/course/[courseName]/modules/ExpandableModule.tsx +++ b/src/app/course/[courseName]/modules/ExpandableModule.tsx @@ -23,22 +23,30 @@ import { Expandable } from "../../../../components/Expandable"; import { useDragStyleContext } from "../context/drag/dragStyleContext"; import { useQuizzesQueries } from "@/hooks/localCourse/quizHooks"; import { useAssignmentNamesQuery } from "@/hooks/localCourse/assignmentHooks"; -import { trpc } from "@/services/serverFunctions/trpcClient"; +import { useTRPC } from "@/services/serverFunctions/trpcClient"; +import { useSuspenseQueries } from "@tanstack/react-query"; export default function ExpandableModule({ moduleName, }: { moduleName: string; }) { + const trpc = useTRPC(); const { itemDropOnModule } = useDraggingContext(); const { courseName } = useCourseContext(); const { data: assignmentNames } = useAssignmentNamesQuery(moduleName); - const [assignments] = trpc.useSuspenseQueries((t) => - assignmentNames.map((assignmentName) => - t.assignment.getAssignment({ courseName, moduleName, assignmentName }) - ) - ); + const assignmentsQueries = useSuspenseQueries({ + queries: assignmentNames.map((assignmentName) => + trpc.assignment.getAssignment.queryOptions({ + courseName, + moduleName, + assignmentName, + }) + ), + }); + const assignments = assignmentsQueries.map((result) => result.data); + const { data: quizzes } = useQuizzesQueries(moduleName); const { data: pages } = usePagesQueries(moduleName); const modal = useModal();