diff --git a/app/src/app/camera/page.tsx b/app/src/app/camera/page.tsx index 0005bb7..db6935e 100644 --- a/app/src/app/camera/page.tsx +++ b/app/src/app/camera/page.tsx @@ -20,7 +20,7 @@ import { PointDialog } from "@/components/view/PointDialog"; import { shapeCaption } from "@/functions/shapeCaption"; import { postSimilarity } from "@/functions/simirality"; import { usePointDialogOpen } from "@/lib/atom"; -import type { ScoreResponse, User, todayAssignment } from "@/types"; +import type { ScoreResponse, DBUser as User, todayAssignment } from "@/types"; import imageCompression from "browser-image-compression"; import type React from "react"; import { useEffect, useRef, useState } from "react"; @@ -107,7 +107,7 @@ const CameraApp = () => { console.error("ユーザー情報が取得できませんでした。"); return; } - const userInfo = JSON.parse(user); + const userInfo: User = JSON.parse(user); setLoginUser(userInfo); const resAssignment = await fetch( `/api/assignment/today?uid=${userInfo?.uid}`, diff --git a/app/src/app/page.tsx b/app/src/app/page.tsx index 1c89589..b2697e1 100755 --- a/app/src/app/page.tsx +++ b/app/src/app/page.tsx @@ -6,7 +6,12 @@ import { Progress } from "@/components/ui/progress"; import { PointDialog } from "@/components/view/PointDialog"; import Timer from "@/components/view/Timer"; import { useHasShownOnce, usePointDialogOpen } from "@/lib/atom"; -import type { MyScoreDetail, Score, todayAssignment } from "@/types"; +import type { + MyScoreDetail, + Score, + DBUser as User, + todayAssignment, +} from "@/types"; import Link from "next/link"; import { useRouter } from "next/navigation"; import { useEffect, useState } from "react"; @@ -37,7 +42,7 @@ export default function Home() { try { // get api/score/me - const userData = JSON.parse(userIdString); + const userData: User = JSON.parse(userIdString); const uid = userData.uid; if (!uid) { throw new Error("User ID not found"); @@ -111,7 +116,9 @@ export default function Home() { const latestAssignment = assignment .filter((item) => item.assignTime) - .sort((a, b) => (b.assignTime?.getTime() ?? 0) - (a.assignTime?.getTime() ?? 0))[0]; + .sort( + (a, b) => (b.assignTime?.getTime() ?? 0) - (a.assignTime?.getTime() ?? 0), + )[0]; return (