diff --git a/bun.lock b/bun.lock
index 2ce379b1..1a31aad0 100644
--- a/bun.lock
+++ b/bun.lock
@@ -429,7 +429,7 @@
"@types/body-parser": ["@types/body-parser@1.19.5", "", { "dependencies": { "@types/connect": "*", "@types/node": "*" } }, "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg=="],
- "@types/bun": ["@types/bun@1.2.3", "", { "dependencies": { "bun-types": "1.2.3" } }, "sha512-054h79ipETRfjtsCW9qJK8Ipof67Pw9bodFWmkfkaUaRiIQ1dIV2VTlheshlBx3mpKr0KeK8VqnMMCtgN9rQtw=="],
+ "@types/bun": ["@types/bun@1.2.4", "", { "dependencies": { "bun-types": "1.2.4" } }, "sha512-QtuV5OMR8/rdKJs213iwXDpfVvnskPXY/S0ZiFbsTjQZycuqPbMW8Gf/XhLfwE5njW8sxI2WjISURXPlHypMFA=="],
"@types/caseless": ["@types/caseless@0.12.5", "", {}, "sha512-hWtVTC2q7hc7xZ/RLbxapMvDMgUnDvKvMOpKal4DrMyfGBUfB1oKaZlIRr6mJL+If3bAP6sV/QneGzF6tJjZDg=="],
@@ -535,7 +535,7 @@
"buffer-equal-constant-time": ["buffer-equal-constant-time@1.0.1", "", {}, "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA=="],
- "bun-types": ["bun-types@1.2.3", "", { "dependencies": { "@types/node": "*", "@types/ws": "~8.5.10" } }, "sha512-P7AeyTseLKAvgaZqQrvp3RqFM3yN9PlcLuSTe7SoJOfZkER73mLdT2vEQi8U64S1YvM/ldcNiQjn0Sn7H9lGgg=="],
+ "bun-types": ["bun-types@1.2.4", "", { "dependencies": { "@types/node": "*", "@types/ws": "~8.5.10" } }, "sha512-nDPymR207ZZEoWD4AavvEaa/KZe/qlrbMSchqpQwovPZCKc7pwMoENjEtHgMKaAjJhy+x6vfqSBA1QU3bJgs0Q=="],
"busboy": ["busboy@1.6.0", "", { "dependencies": { "streamsearch": "^1.1.0" } }, "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA=="],
diff --git a/server/prisma/schema.prisma b/server/prisma/schema.prisma
index b1bb051a..8f6bb750 100644
--- a/server/prisma/schema.prisma
+++ b/server/prisma/schema.prisma
@@ -35,7 +35,7 @@ model User {
faculty String
department String
intro String
- pictureUrl String
+ pictureUrl String @default("/avatar.svg")
// bindings to other parts of this app
enrollments Enrollment[]
@@ -67,7 +67,7 @@ model InterestSubject {
// User->Interest->InterestSubject
model Interest {
userId Int
- user User @relation(fields: [userId], references: [id])
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade )
subjectId Int
subject InterestSubject @relation(fields: [subjectId], references: [id], onDelete: Cascade)
diff --git a/server/src/router/picture.ts b/server/src/router/picture.ts
index 75c6c831..1332bdd7 100644
--- a/server/src/router/picture.ts
+++ b/server/src/router/picture.ts
@@ -12,7 +12,7 @@ import { error } from "../lib/error";
import * as hashing from "../lib/hash";
const largeLimit = bodyLimit({
- maxSize: 50 * 1024, // 50kb
+ maxSize: 50 * 1024 * 1024, // 50mb
onError: (c) => {
return c.text("overflow :(", 413);
},
diff --git a/server/src/router/users.ts b/server/src/router/users.ts
index ece37091..1a1a6a31 100644
--- a/server/src/router/users.ts
+++ b/server/src/router/users.ts
@@ -107,7 +107,7 @@ const router = new Hono()
// INSERT INTO "User" VALUES (body...)
.post("/", async (c) => {
- const partialUser = InitUserSchema.parse(c.body);
+ const partialUser = InitUserSchema.parse(await c.req.json());
const user = await createUser(partialUser);
//ユーザー作成と同時にメモとマッチング
@@ -119,7 +119,7 @@ const router = new Hono()
// ユーザーの更新エンドポイント
.put("/me", async (c) => {
const id = await getUserId(c);
- const user = UpdateUserSchema.parse(c.body);
+ const user = UpdateUserSchema.parse(await c.req.json());
const updated = await updateUser(id, user);
c.status(200);
return c.json(updated);
diff --git a/web/app/chat/[id]/page.tsx b/web/app/chat/[id]/page.tsx
index 86858436..fe6112fb 100644
--- a/web/app/chat/[id]/page.tsx
+++ b/web/app/chat/[id]/page.tsx
@@ -4,23 +4,33 @@ import Link from "next/link";
import { useEffect, useState } from "react";
import * as chat from "~/api/chat/chat";
import { RoomWindow } from "~/components/chat/RoomWindow";
+import FullScreenCircularProgress from "~/components/common/FullScreenCircularProgress";
export default function Page({ params }: { params: { id: string } }) {
const id = Number.parseInt(params.id);
const [room, setRoom] = useState<(DMRoom & PersonalizedDMRoom) | null>(null);
+ const [loading, setLoading] = useState(true);
+
useEffect(() => {
(async () => {
- const room = await chat.getDM(id);
- setRoom(room);
+ try {
+ const room = await chat.getDM(id);
+ setRoom(room);
+ } finally {
+ setLoading(false);
+ }
})();
}, [id]);
+ if (loading) {
+ return
Sorry, an unexpected error has occurred.
diff --git a/web/app/home/page.tsx b/web/app/home/page.tsx
index ba4320df..b6c0a7b1 100644
--- a/web/app/home/page.tsx
+++ b/web/app/home/page.tsx
@@ -28,9 +28,13 @@ export default function Home() {
const [recommended, setRecommended] = useState<
Queue