포스트 작성페이지 → 서버
🚨 title과 meta는 JSON.stringify 하여 넣음
{ channelId: '동영2팀 채널 id', title: { category: [선택된 카테고리 이름 배열], techStack: [선택된 기술스택 이름 배열], }, meta: { title: '포스트 제목', description: '포스트 설명글', deployLink: '배포 주소', githubLink: '소스코드 주소', collabo: boolean }, image: 이미지파일 }
채널 전체 포스트 목록 (서버 → MainPage)
[ { "likes": [], "comments": [], "_id": "617c0341e60eea5fdb9e7d8f", "title": "{\"category\":[\"커뮤니티\",\"교육\"],\"techStack\":[]}", "image": "https://res.cloudinary.com/dyt02nbtq/image/upload/v1635517248/post/79ca40ff-bedd-4fbf-ad14-34d8391d0dc2.png", "imagePublicId": "post/79ca40ff-bedd-4fbf-ad14-34d8391d0dc2", "channel": { "authRequired": false, "posts": [ "617c0238e60eea5fdb9e7d66", "617c0341e60eea5fdb9e7d8f" ], "_id": "616a202922996f0bc94f6de9", "name": "동영 2팀", "description": "", "createdAt": "2021-10-16T00:43:21.566Z", "updatedAt": "2021-10-30T06:17:11.274Z", "__v": 0 }, "author": { "role": "Regular", "emailVerified": false, "banned": false, "isOnline": false, "posts": [], "likes": [], "comments": [], "followers": [], "following": [ "616ee7ba69d47c3124d8a48d" ], "notifications": [], "messages": [], "_id": "616ee77869d47c3124d8a485", "fullName": "kim42", "email": "42@naver.com", "createdAt": "2021-10-19T15:42:48.967Z", "updatedAt": "2021-10-30T06:17:11.275Z", "__v": 0, "username": "4242", "meta": null }, "meta": "{\"title\":\"테스트\",\"description\":\"ㅌㅌ\",\"deployLink\":\"\",\"githubLink\":\"\",\"collabo\":false}", "createdAt": "2021-10-29T14:20:49.188Z", "updatedAt": "2021-10-29T14:20:49.188Z", "__v": 0 }, {}, {}, ... ]
MainPage → PostList (여기 정민님이 받아야할 데이터 넣어주세요!)
{ postId: 1, //post의 아이디 userId: category: ['재미', '교육'], image: 'https://picsum.photos/200?1', //post이미지 하나만 techStack: [선택된 기술스택들], likes: 30, //좋아요 갯수 title: '프로젝트1', description: '프로젝트 소개입니다. 안녕하세요 서비스를 제공합니다.', userProfile: 'https://picsum.photos/200?1', userName: 'user1', updatedAt: '2021-02-20', //포스트 작성 날짜 } category, image, techStack, likes, title, description, userName, updatedAt 이름 수정했음!
AuthContext에 있는 데이터
const { userInfo } = useAuthContext(); 로 사용가능
// userInfo { userId: '', userProfile: '', userName: '', likes: [], // 좋아요 배열 comments: [], // 배열 followers: [], // 배열 following: [], // 배열 email: '', isOnline: '' // boolean }