
[URECA] Day79 LabbitLog 블로그 만들기 #6
·
💡 URECA/🗒️ 스터디 노트
📆 5월 30일 마이페이지 데이터 연동 (내 글/댓글/좋아요/정보)내 게시글 가져오기 (/users/:username/posts)const posts = await Post.find({ author: username }).sort({ createdAt: -1 });유저별로 author 기준 필터링최신순 정렬(sort({ createdAt: -1 }))프론트에선 리스트로 출력내 댓글 가져오기 (/users/:username/comments)const comments = await Comment.find({ username }).sort({ createdAt: -1 });작성자 기준으로 댓글 조회마찬가지로 최신순 정렬좋아요한 글 목록 (/users/:username/likes)const likedPosts..