linting more trpc

This commit is contained in:
2024-11-11 13:20:08 -07:00
parent cc8d004aa4
commit 61359a5e7d
36 changed files with 1076 additions and 662 deletions

View File

@@ -2,18 +2,14 @@ import type { Metadata } from "next";
import "./globals.css";
import Providers from "./providers";
import { Suspense } from "react";
import { getQueryClient } from "./providersQueryClientUtils";
import { hydrateCourses } from "@/hooks/hookHydration";
import { dehydrate, hydrate, HydrationBoundary } from "@tanstack/react-query";
import { dehydrate, HydrationBoundary } from "@tanstack/react-query";
import { MyToaster } from "./MyToaster";
import { cookies } from "next/headers";
import { createServerSideHelpers } from "@trpc/react-query/server";
import { trpcAppRouter } from "@/services/trpc/router/app";
import { createTrpcContext } from "@/services/trpc/context";
import superjson from "superjson";
import { fileStorageService } from "@/services/fileStorage/fileStorageService";
import ClientOnly from "@/components/ClientOnly";
import { createTRPCQueryUtils } from "@trpc/react-query";
export const dynamic = "force-dynamic";
export const metadata: Metadata = {
@@ -60,35 +56,35 @@ async function DataHydration({
},
},
});
const allSettings = await fileStorageService.settings.getAllCoursesSettings();
await Promise.all(
allSettings.map(async (settings) => {
const courseName = settings.name;
const moduleNames = await fileStorageService.modules.getModuleNames(
courseName
);
await Promise.all(
moduleNames.map(
async (moduleName) =>
await trpcHelper.assignment.getAllAssignments.fetch({
courseName,
moduleName,
})
)
);
})
);
// const allSettings = await fileStorageService.settings.getAllCoursesSettings();
// await Promise.all(
// allSettings.map(async (settings) => {
// const courseName = settings.name;
// const moduleNames = await fileStorageService.modules.getModuleNames(
// courseName
// );
// await Promise.all(
// moduleNames.map(
// async (moduleName) =>
// await trpcHelper.assignment.getAllAssignments.fetch({
// courseName,
// moduleName,
// })
// )
// );
// })
// );
await Promise.all(
allSettings.map(
async (settings) =>
await trpcHelper.lectures.getLectures.fetch({
courseName: settings.name,
})
)
);
// await Promise.all(
// allSettings.map(
// async (settings) =>
// await trpcHelper.lectures.getLectures.fetch({
// courseName: settings.name,
// })
// )
// );
await hydrateCourses(trpcHelper.queryClient);
// await hydrateCourses(trpcHelper.queryClient);
const dehydratedState = dehydrate(trpcHelper.queryClient);
console.log("ran hydration");