From deb05f51a5bb2c7c15575afd19a8fa60a05d90b3 Mon Sep 17 00:00:00 2001 From: Ashish Date: Mon, 11 Aug 2025 14:05:13 +0530 Subject: [PATCH 1/5] fixed some bugs before running build --- apps/merchant-app/app/api/user/route.ts | 10 ++++----- apps/merchant-app/lib/auth.ts | 30 ++++++++++++------------- packages/store/package.json | 2 +- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/apps/merchant-app/app/api/user/route.ts b/apps/merchant-app/app/api/user/route.ts index fd5df92..bef4147 100644 --- a/apps/merchant-app/app/api/user/route.ts +++ b/apps/merchant-app/app/api/user/route.ts @@ -1,13 +1,13 @@ import { NextResponse } from "next/server" -import { PrismaClient } from "@repo/db/client"; - -const client = new PrismaClient(); +import prisma from "@repo/db/client"; export const GET = async () => { - await client.user.create({ + await prisma.user.create({ data: { email: "asd", - name: "adsads" + name: "adsads", + password:"secret", + number:"123" } }) return NextResponse.json({ diff --git a/apps/merchant-app/lib/auth.ts b/apps/merchant-app/lib/auth.ts index 8d38ac0..b429d48 100644 --- a/apps/merchant-app/lib/auth.ts +++ b/apps/merchant-app/lib/auth.ts @@ -9,19 +9,19 @@ export const authOptions = { }) ], callbacks: { - async signIn({ user, account }: { - user: { - email: string; - name: string - }, - account: { - provider: "google" | "github" - } - }) { - console.log("hi signin") - if (!user || !user.email) { - return false; - } + async signIn(params: { + user: { email?: string | null; name?: string | null; [key: string]: any }; + account: { provider: string } | null; + profile?: any; + email?: any; + credentials?: any; + }) { + const { user, account } = params; + + console.log("hi signin"); + if (!user || !user.email) { + return false; + } await db.merchant.upsert({ select: { @@ -33,11 +33,11 @@ export const authOptions = { create: { email: user.email, name: user.name, - auth_type: account.provider === "google" ? "Google" : "Github" // Use a prisma type here + auth_type: account?.provider === "google" ? "Google" : "Github" // Use a prisma type here }, update: { name: user.name, - auth_type: account.provider === "google" ? "Google" : "Github" // Use a prisma type here + auth_type: account?.provider === "google" ? "Google" : "Github" // Use a prisma type here } }); diff --git a/packages/store/package.json b/packages/store/package.json index b92ae80..c652f65 100644 --- a/packages/store/package.json +++ b/packages/store/package.json @@ -6,6 +6,6 @@ "recoil": "^0.7.7" }, "exports": { - "./balance": "./src/hooks/useBalance" + "./balance": "./src/hooks/useBalance.ts" } } From 9f4d7437d2b4492ac8d038f0f65cd2e5ab8903f0 Mon Sep 17 00:00:00 2001 From: Ashish Date: Mon, 11 Aug 2025 17:10:14 +0530 Subject: [PATCH 2/5] fix --- apps/merchant-app/app/page.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/merchant-app/app/page.tsx b/apps/merchant-app/app/page.tsx index f72d01d..e66c2ec 100644 --- a/apps/merchant-app/app/page.tsx +++ b/apps/merchant-app/app/page.tsx @@ -2,6 +2,9 @@ import { useBalance } from "@repo/store/balance"; + + + export default function() { const balance = useBalance(); return
From b07e8ba6ed844c4c58cb77271b4b1cc776a4d546 Mon Sep 17 00:00:00 2001 From: Ashish Date: Mon, 11 Aug 2025 17:30:55 +0530 Subject: [PATCH 3/5] added div in page --- apps/merchant-app/app/page.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/merchant-app/app/page.tsx b/apps/merchant-app/app/page.tsx index e66c2ec..7bf9162 100644 --- a/apps/merchant-app/app/page.tsx +++ b/apps/merchant-app/app/page.tsx @@ -8,6 +8,9 @@ import { useBalance } from "@repo/store/balance"; export default function() { const balance = useBalance(); return
+
+ hi +
hi there {balance}
} \ No newline at end of file From 2a885382daa14e6e5d879186b54b521596b4ea08 Mon Sep 17 00:00:00 2001 From: Ashish Date: Mon, 11 Aug 2025 17:47:49 +0530 Subject: [PATCH 4/5] fixed some bugs --- apps/merchant-app/app/api/user/route.ts | 15 +++++++++------ packages/db/tsconfig.json | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/apps/merchant-app/app/api/user/route.ts b/apps/merchant-app/app/api/user/route.ts index bef4147..20e73ab 100644 --- a/apps/merchant-app/app/api/user/route.ts +++ b/apps/merchant-app/app/api/user/route.ts @@ -2,12 +2,15 @@ import { NextResponse } from "next/server" import prisma from "@repo/db/client"; export const GET = async () => { - await prisma.user.create({ - data: { - email: "asd", - name: "adsads", - password:"secret", - number:"123" + await prisma.user.upsert({ + where: { + email: "asd"}, + update:{}, + create:{ + email:"add", + name: "adsads", + password:"secret", + number:"123" } }) return NextResponse.json({ diff --git a/packages/db/tsconfig.json b/packages/db/tsconfig.json index 872a7a3..5fd6fc8 100644 --- a/packages/db/tsconfig.json +++ b/packages/db/tsconfig.json @@ -3,7 +3,7 @@ "compilerOptions": { "outDir": "dist" }, - "include": ["src"], + "include": ["."], "exclude": ["node_modules", "dist"] } \ No newline at end of file From 2d3a8c00e53ed5d5c19d7f4b1cd8b5c8f536c324 Mon Sep 17 00:00:00 2001 From: Ashish Date: Mon, 11 Aug 2025 17:57:50 +0530 Subject: [PATCH 5/5] added some text in dev --- apps/merchant-app/app/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/merchant-app/app/page.tsx b/apps/merchant-app/app/page.tsx index 7bf9162..c44a015 100644 --- a/apps/merchant-app/app/page.tsx +++ b/apps/merchant-app/app/page.tsx @@ -9,7 +9,7 @@ export default function() { const balance = useBalance(); return
- hi + added a new div here
hi there {balance}