From 702a032941272eff8caad67b42f12bd4a2040927 Mon Sep 17 00:00:00 2001
From: KaichiManabe <154493010+KaichiManabe@users.noreply.github.com>
Date: Thu, 20 Feb 2025 19:48:39 +0900
Subject: [PATCH 1/4] =?UTF-8?q?user/exist=E3=81=AE=E3=82=B3=E3=83=BC?=
=?UTF-8?q?=E3=83=89=E3=82=92=E3=82=88=E3=82=8A=E7=B0=A1=E6=BD=94=E3=81=AB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
server/src/router/users.ts | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/server/src/router/users.ts b/server/src/router/users.ts
index 771c9fca..ece37091 100644
--- a/server/src/router/users.ts
+++ b/server/src/router/users.ts
@@ -7,6 +7,7 @@ import {
} from "common/zod/schemas";
import { Hono } from "hono";
import { z } from "zod";
+import { prisma } from "../database/client";
import {
getPendingRequestsFromUser,
getPendingRequestsToUser,
@@ -51,9 +52,17 @@ const router = new Hono()
// ユーザーの存在を確認するためのエンドポイント。だれでもアクセス可能
.get("/exists/:guid", param({ guid: z.string() }), async (c) => {
const guid = c.req.valid("param").guid;
- const ok = await core.userExists(guid as GUID);
- c.status(ok.code);
- return c.json({});
+ const user = await prisma.user.findFirst({
+ where: {
+ guid: guid,
+ },
+ select: { guid: true, name: true },
+ });
+ if (!user) {
+ return c.json({ message: "User not found" }, 404);
+ }
+
+ return c.json(200);
})
// 特定のユーザーとマッチしたユーザーを取得
From 5375030ff20e997130428922a86a0f43d4521bb0 Mon Sep 17 00:00:00 2001
From: KaichiManabe <154493010+KaichiManabe@users.noreply.github.com>
Date: Thu, 20 Feb 2025 19:58:17 +0900
Subject: [PATCH 2/4] delete authProvider and delete unnessesary req
---
web/app/layout.tsx | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/web/app/layout.tsx b/web/app/layout.tsx
index 254ffcf8..b46cea1f 100644
--- a/web/app/layout.tsx
+++ b/web/app/layout.tsx
@@ -45,15 +45,13 @@ export default function RootLayout({
anchorOrigin={{ horizontal: "right", vertical: "top" }}
>
-
-
-
-
-
- {children}
-
-
-
+
+
+
+
+ {children}
+
+
From 280372655b1ef0f7f8f53afe1831249204b64f54 Mon Sep 17 00:00:00 2001
From: KaichiManabe <154493010+KaichiManabe@users.noreply.github.com>
Date: Thu, 20 Feb 2025 20:22:48 +0900
Subject: [PATCH 3/4] =?UTF-8?q?useModal=E3=82=92=E5=BF=85=E8=A6=81?=
=?UTF-8?q?=E3=81=AA=E3=81=A8=E3=81=93=E3=82=8D=E3=81=A0=E3=81=91=E3=81=AB?=
=?UTF-8?q?=E3=81=97=E3=81=9F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
web/app/chat/layout.tsx | 20 ++++++++++----------
web/app/friends/layout.tsx | 20 ++++++++++----------
web/app/layout.tsx | 10 ++++------
web/app/search/layout.tsx | 20 ++++++++++----------
4 files changed, 34 insertions(+), 36 deletions(-)
diff --git a/web/app/chat/layout.tsx b/web/app/chat/layout.tsx
index a2c62fd9..d49ebc3b 100644
--- a/web/app/chat/layout.tsx
+++ b/web/app/chat/layout.tsx
@@ -1,19 +1,19 @@
+"use client";
import BottomBar from "~/components/BottomBar";
import Header from "~/components/Header";
import { NavigateByAuthState } from "~/components/common/NavigateByAuthState";
+import { ModalProvider } from "~/components/common/modal/ModalProvider";
-export default function Layout({
- children,
-}: {
- children: React.ReactNode;
-}) {
+export default function Layout({ children }: { children: React.ReactNode }) {
return (
<>
-
-
- {children}
-
-
+
+
+
+ {children}
+
+
+
>
);
}
diff --git a/web/app/friends/layout.tsx b/web/app/friends/layout.tsx
index b5295993..2a0cae8d 100644
--- a/web/app/friends/layout.tsx
+++ b/web/app/friends/layout.tsx
@@ -1,19 +1,19 @@
+"use client";
import BottomBar from "~/components/BottomBar";
import Header from "~/components/Header";
import { NavigateByAuthState } from "~/components/common/NavigateByAuthState";
+import { ModalProvider } from "~/components/common/modal/ModalProvider";
-export default function Layout({
- children,
-}: {
- children: React.ReactNode;
-}) {
+export default function Layout({ children }: { children: React.ReactNode }) {
return (
<>
-
-
- {children}
-
-
+
+
+
+ {children}
+
+
+
>
);
}
diff --git a/web/app/layout.tsx b/web/app/layout.tsx
index b46cea1f..17a6a4bd 100644
--- a/web/app/layout.tsx
+++ b/web/app/layout.tsx
@@ -10,8 +10,6 @@ import "@fontsource/roboto/500.css";
import "@fontsource/roboto/700.css";
import BanLandscape from "~/components/BanLandscape";
import { AlertProvider } from "~/components/common/alert/AlertProvider";
-import { ModalProvider } from "~/components/common/modal/ModalProvider";
-import AuthProvider from "~/firebase/auth/AuthProvider";
const theme = createTheme({
palette: {
@@ -47,10 +45,10 @@ export default function RootLayout({
-
-
- {children}
-
+ {/* */}
+
+ {children}
+ {/* */}
diff --git a/web/app/search/layout.tsx b/web/app/search/layout.tsx
index 3f75b04d..62ab9650 100644
--- a/web/app/search/layout.tsx
+++ b/web/app/search/layout.tsx
@@ -1,19 +1,19 @@
+"use client";
import BottomBar from "~/components/BottomBar";
import Header from "~/components/Header";
import { NavigateByAuthState } from "~/components/common/NavigateByAuthState";
+import { ModalProvider } from "~/components/common/modal/ModalProvider";
-export default function Layout({
- children,
-}: {
- children: React.ReactNode;
-}) {
+export default function Layout({ children }: { children: React.ReactNode }) {
return (
<>
-
-
- {children}
-
-
+
+
+
+ {children}
+
+
+
>
);
}
From 333502475759d32bc8eacb7df3ad1485d1799945 Mon Sep 17 00:00:00 2001
From: KaichiManabe <154493010+KaichiManabe@users.noreply.github.com>
Date: Thu, 20 Feb 2025 20:42:15 +0900
Subject: [PATCH 4/4] delete unnecessary
---
web/app/chat/layout.tsx | 1 -
web/app/friends/layout.tsx | 1 -
web/app/search/layout.tsx | 1 -
web/components/common/modal/ModalProvider.tsx | 1 +
4 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/web/app/chat/layout.tsx b/web/app/chat/layout.tsx
index d49ebc3b..fabe653b 100644
--- a/web/app/chat/layout.tsx
+++ b/web/app/chat/layout.tsx
@@ -1,4 +1,3 @@
-"use client";
import BottomBar from "~/components/BottomBar";
import Header from "~/components/Header";
import { NavigateByAuthState } from "~/components/common/NavigateByAuthState";
diff --git a/web/app/friends/layout.tsx b/web/app/friends/layout.tsx
index 2a0cae8d..0146483c 100644
--- a/web/app/friends/layout.tsx
+++ b/web/app/friends/layout.tsx
@@ -1,4 +1,3 @@
-"use client";
import BottomBar from "~/components/BottomBar";
import Header from "~/components/Header";
import { NavigateByAuthState } from "~/components/common/NavigateByAuthState";
diff --git a/web/app/search/layout.tsx b/web/app/search/layout.tsx
index 62ab9650..87bbc6a3 100644
--- a/web/app/search/layout.tsx
+++ b/web/app/search/layout.tsx
@@ -1,4 +1,3 @@
-"use client";
import BottomBar from "~/components/BottomBar";
import Header from "~/components/Header";
import { NavigateByAuthState } from "~/components/common/NavigateByAuthState";
diff --git a/web/components/common/modal/ModalProvider.tsx b/web/components/common/modal/ModalProvider.tsx
index 99fe463c..7ac0e775 100644
--- a/web/components/common/modal/ModalProvider.tsx
+++ b/web/components/common/modal/ModalProvider.tsx
@@ -1,3 +1,4 @@
+"use client";
import type { UserWithCoursesAndSubjects } from "common/types";
import { type ReactNode, createContext, useContext, useState } from "react";
import { useAboutMe } from "~/api/user";