[#139] fix(memo): homepage_owner의 닉네임을 글쓴이로 지정하도록 수정#144
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug where memo post list items were displaying the logged-in user's nickname instead of the homepage owner's nickname. The implementation now correctly fetches and displays the homepage owner's nickname.
- Removed incorrect use of
useAuthUserhook for author name - Implemented a JOIN query to fetch the homepage owner's nickname from the profiles table
- Added state management to store and pass the owner's nickname to PostItem components
Comments suppressed due to low confidence (1)
src/features/minihome/post/list/PostList.tsx:21
- The
ownerNicknamestate should be reset when the component starts fetching new data. Currently, if theownerIdprop changes or if the homepage query fails (lines 34-38), the state retains the previous owner's nickname, which could display incorrect information.
Consider resetting the state at the beginning of fetchPosts():
async function fetchPosts() {
setIsLoading(true);
setOwnerNickname("주인장"); // Reset to default
if (!ownerId) {
setIsLoading(false);
return;
}
// ... rest of the function async function fetchPosts() {
setIsLoading(true);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📖 개요
메모 게시글 리스트가 로그인 사용자 닉네임으로 표시되던 문제를 고치고, 홈 주인의 닉네임을 가져와 보여주도록 수정했습니다.
✅ 관련 이슈
🛠️ 상세 작업 내용
📸 스크린샷
👥 리뷰 확인 사항