diff --git a/frontend/src/app/api/profile.ts b/frontend/src/app/api/profile.ts index 6eca42d..3100627 100644 --- a/frontend/src/app/api/profile.ts +++ b/frontend/src/app/api/profile.ts @@ -1,5 +1,6 @@ const API_BASE = import.meta.env.VITE_API_BASE_URL; const TOKEN_KEY = 'hyfive_token'; +const PET_ID_KEY = 'hyfive_petId'; // ── Types ────────────────────────────────────────────────────────────────────── @@ -143,5 +144,7 @@ export async function activatePet(petId: number): Promise { method: 'PATCH', headers: authHeaders(), }); - return parse(res); + const pet = await parse(res); + localStorage.setItem(PET_ID_KEY, String(petId)); + return pet; } \ No newline at end of file diff --git a/frontend/src/app/components/HealthLogScreen.tsx b/frontend/src/app/components/HealthLogScreen.tsx index cbbd2f1..4686d0f 100644 --- a/frontend/src/app/components/HealthLogScreen.tsx +++ b/frontend/src/app/components/HealthLogScreen.tsx @@ -15,6 +15,8 @@ import { type FecalState = '정상' | '무름' | '딱딱함' | '혈변' | '없음'; +const CURRENT_PET_ID = Number(localStorage.getItem('hyfive_petId') ?? '1'); + const FECAL_TO_API: Record = { '정상': 'NORMAL', '무름': 'SOFT', '딱딱함': 'HARD', '혈변': 'BLOOD', '없음': 'NONE', }; diff --git a/frontend/src/app/components/PetProfileScreen.tsx b/frontend/src/app/components/PetProfileScreen.tsx index 4824439..e005b78 100644 --- a/frontend/src/app/components/PetProfileScreen.tsx +++ b/frontend/src/app/components/PetProfileScreen.tsx @@ -254,12 +254,8 @@ export default function PetProfileScreen() { {/* Vaccine / Prevention */}
-
+

예방접종 · 투약 현황

-
{vaccineRecords.map((v, i) => (