diff --git a/frontend/src/components/village/VillageContainer.tsx b/frontend/src/components/village/VillageContainer.tsx index 14fa996..ca37ac7 100644 --- a/frontend/src/components/village/VillageContainer.tsx +++ b/frontend/src/components/village/VillageContainer.tsx @@ -9,6 +9,7 @@ import { UserItem, UserProfile, Village } from '../../types'; import { getVillageAll } from '../../service/village'; import { checkVillageDistance } from '../../app/util'; import { PositionContext } from '../../app/layout'; +import { NORMAL_IMG_KEY, USER_ID_KEY } from '../../constants'; export default function VillageContainer() { const [toggleStart, setToggleStart] = useState(false); @@ -24,8 +25,9 @@ export default function VillageContainer() { useEffect(() => { (async () => { - const profile = getUserProfile(1); - const items = getUserItems(1); + const userId = Number(sessionStorage.getItem(USER_ID_KEY)); + const profile = getUserProfile(userId); + const items = getUserItems(userId); Promise.all([profile, items]).then((res) => { setUserProfile(res[0]); setUserItems(res[1]); @@ -80,7 +82,7 @@ export default function VillageContainer() {