Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion frontend/src/app/api/profile.ts
Original file line number Diff line number Diff line change
@@ -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 ──────────────────────────────────────────────────────────────────────

Expand Down Expand Up @@ -143,5 +144,7 @@ export async function activatePet(petId: number): Promise<PetProfileResponse> {
method: 'PATCH',
headers: authHeaders(),
});
return parse<PetProfileResponse>(res);
const pet = await parse<PetProfileResponse>(res);
localStorage.setItem(PET_ID_KEY, String(petId));
return pet;
}
2 changes: 2 additions & 0 deletions frontend/src/app/components/HealthLogScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import {

type FecalState = '정상' | '무름' | '딱딱함' | '혈변' | '없음';

const CURRENT_PET_ID = Number(localStorage.getItem('hyfive_petId') ?? '1');

const FECAL_TO_API: Record<FecalState, BowelStatus> = {
'정상': 'NORMAL', '무름': 'SOFT', '딱딱함': 'HARD', '혈변': 'BLOOD', '없음': 'NONE',
};
Expand Down
6 changes: 1 addition & 5 deletions frontend/src/app/components/PetProfileScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,8 @@ export default function PetProfileScreen() {

{/* Vaccine / Prevention */}
<div>
<div className="flex items-center justify-between mb-2">
<div className="flex items-center mb-2">
<p style={{ fontSize: '13px', fontWeight: 700, color: '#0D2B5E' }}>예방접종 · 투약 현황</p>
<button className="flex items-center gap-0.5">
<span style={{ fontSize: '11px', color: '#1B4B8C', fontWeight: 600 }}>전체보기</span>
<ChevronRight size={12} style={{ color: '#1B4B8C' }} />
</button>
</div>
<div className="bg-white rounded-2xl overflow-hidden" style={{ border: '1px solid #E0E0E0' }}>
{vaccineRecords.map((v, i) => (
Expand Down
Loading