Skip to content

Commit

Permalink
resolve ts issues
Browse files Browse the repository at this point in the history
  • Loading branch information
xiduzo committed May 10, 2024
1 parent 671b1f0 commit 4e69bc6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions apps/nextjs/src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
import "../styles/globals.css";

import type { AppType } from "next/app";
import { Analytics } from "@vercel/analytics/react";
import type { Session } from "next-auth";
import { SessionProvider } from "next-auth/react";
import type { AppType } from "next/app";

import { api } from "~/utils/api";
import { ToastContainer } from "~/components/Toast";
import { ThemeProvider } from "~/providers/ThemeProvider";
import { api } from "~/utils/api";

const MyApp: AppType<{ session: Session | null }> = ({
Component,
pageProps: { session, ...pageProps },
}) => {
// eslint-disable-next-line
const MyComponent = Component as any;
return (
<SessionProvider session={session}>
<Analytics />
<ThemeProvider>
<Component {...pageProps} />
<MyComponent {...pageProps} />
<ToastContainer />
</ThemeProvider>
</SessionProvider>
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs/src/pages/api/cron/sync-fissa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const globalForPrisma = globalThis as unknown as { prisma: PrismaClient };
export const prisma = globalForPrisma.prisma || new PrismaClient();

export default async function handler(_: NextApiRequest, res: NextApiResponse) {
const caller = appRouter.createCaller({ prisma, session: null });
const caller = appRouter.createCaller({ database: prisma, session: null });

const fissas = await caller.fissa.sync.active();

Expand Down
6 changes: 3 additions & 3 deletions apps/nextjs/src/pages/api/cron/sync-token.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { type NextApiRequest, type NextApiResponse } from "next";
import { PrismaClient } from "@prisma/client";
import { appRouter } from "@fissa/api";
import { PrismaClient } from "@prisma/client";
import { type NextApiRequest, type NextApiResponse } from "next";

const globalForPrisma = globalThis as unknown as { prisma: PrismaClient };

export const prisma = globalForPrisma.prisma || new PrismaClient();

export default async function handler(_: NextApiRequest, res: NextApiResponse) {
const caller = appRouter.createCaller({
prisma,
database: prisma,
session: null,
});

Expand Down

0 comments on commit 4e69bc6

Please sign in to comment.