Skip to content

Commit

Permalink
chore: fix build.
Browse files Browse the repository at this point in the history
  • Loading branch information
ezeikel committed Nov 23, 2024
1 parent d4d658c commit 29f5042
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 19 deletions.
12 changes: 9 additions & 3 deletions apps/web/app/global-error.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
"use client";

import * as Sentry from "@sentry/nextjs";
import NextError from "next/error";
import { useEffect } from "react";

const GlobalError = ({ error }: { error: Error & { digest?: string } }) => {
const GlobalError = ({
error,
reset,
}: {
error: Error & { digest?: string };
reset: () => void;
}) => {
useEffect(() => {
Sentry.captureException(error);
}, [error]);

return (
<html lang="en">
<body>
<NextError statusCode={0} />
<h2>Something went wrong!</h2>
<button onClick={() => reset()}>Try again</button>
</body>
</html>
);
Expand Down
2 changes: 1 addition & 1 deletion apps/web/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const config = {
},
async session({ session, token }: { session: Session; token: JWT }) {
const dbUser = token.email
? await prisma.user.findUnique({
? await db.user.findUnique({
where: { email: token.email as string },
})
: null;
Expand Down
4 changes: 2 additions & 2 deletions apps/web/components/Nav/NavItems.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import Link from "next/link";
import type { User } from "@prisma/client";
import type { DbUserType } from "@cuurly/db";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import type { IconDefinition } from "@fortawesome/fontawesome-svg-core";
import {
Expand All @@ -12,7 +12,7 @@ import {
} from "@fortawesome/pro-light-svg-icons";

type NavItemsProps = {
user: User;
user: DbUserType;
};

type NavItemType = {
Expand Down
4 changes: 2 additions & 2 deletions apps/web/hooks/api/useUser.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useQuery } from "@tanstack/react-query";
import { getCurrentUser } from "@/app/actions";
import type { User } from "@prisma/client";
import type { DbUserType } from "@cuurly/db";

type UserResponse = User | null;
type UserResponse = DbUserType | null;

const useUser = () =>
useQuery<UserResponse>({
Expand Down
17 changes: 9 additions & 8 deletions apps/web/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@cuurly/web",
"author": "[email protected]",
"version": "0.1.0",
"private": true,
"scripts": {
"clean": "git clean -xdf .next .turbo node_modules",
"dev": "next dev --turbo",
"dev": "next dev --turbopack",
"build": "next build",
"start": "next start",
"lint": "eslint",
Expand Down Expand Up @@ -56,10 +56,10 @@
"jsonwebtoken": "^9.0.2",
"lodash.debounce": "^4.0.8",
"lodash.isequal": "^4.5.0",
"next": "15.0.1",
"next": "15.0.3",
"next-auth": "beta",
"react": "19.0.0-rc-69d4b800-20241021",
"react-dom": "19.0.0-rc-69d4b800-20241021",
"react": "19.0.0-rc-66855b96-20241106",
"react-dom": "19.0.0-rc-66855b96-20241106",
"react-dropzone": "^14.2.10",
"react-modal": "^3.16.1",
"react-responsive": "^10.0.0",
Expand All @@ -82,7 +82,7 @@
"@types/lodash.debounce": "^4.0.9",
"@types/lodash.isequal": "^4.5.8",
"@types/node": "^22.8.1",
"@types/react": "18.3.12",
"@types/react": "npm:[email protected]",
"@types/react-fontawesome": "^1.6.8",
"@types/react-modal": "^3.16.3",
"@types/react-responsive": "^8.0.8",
Expand All @@ -107,7 +107,8 @@
"typescript": "^5.6.3",
"typescript-eslint": "latest"
},
"resolutions": {
"@types/react": "npm:[email protected]"
"overrides": {
"@types/react": "npm:[email protected]",
"@types/react-dom": "npm:[email protected]"
}
}
2 changes: 1 addition & 1 deletion apps/web/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Prisma } from "@prisma/client";
import type { Prisma } from "@cuurly/db";

export type GetPost = Prisma.PostGetPayload<{
select: {
Expand Down
4 changes: 2 additions & 2 deletions apps/web/utils/processFile.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { MediaType } from "@prisma/client";
import type { DbMediaType } from "@cuurly/db";
import processUpload from "./processUpload";

const processFile = async ({
Expand All @@ -10,7 +10,7 @@ const processFile = async ({
tags: string[];
userId: string;
}) => {
let fileType: MediaType;
let fileType: DbMediaType;
const { createReadStream, mimetype } = await file;

switch (mimetype) {
Expand Down

0 comments on commit 29f5042

Please sign in to comment.