sparcs-kaist / new-ara-web

KAIST Community Ara Renewal Project
https://ara.kaist.ac.kr
MIT License
21 stars 3 forks source link

Fix front console errors #375

Closed 000wan closed 1 year ago

000wan commented 1 year ago

https://www.notion.so/sparcs/e027e467dcc04d2596d2b0f9bdfaa0d8

1. src/components/SmallBoard.vue

TypeError: Cannot read properties of null (reading 'profile')

DB article에 created_by.profile: null인 게시물이 있어서 db에 직접 profile을 추가하여 해결했습니다.

2. src/components/PostCommentEditor.vue

TypeError: Cannot read properties of undefined (reading 'profile')

isVerified()에서 post.my_comment_profile이 undefined일 경우 false를 return하도록 변경하였습니다.

또한 post.my_comment_profile이 정의되었다면 post.my_comment_profile.profile 또한 정의되므로 profile 뒤의 Optional chaining operator를 제거하였습니다. 반면 post.parent_board는 undefined일 수 있으므로 Optional chaining operator를 추가하였습니다.

3. src/components/ThePostHeader.vue

TypeError: Cannot read properties of undefined (reading 'slug')

post.parent_board의 slug와 name을 computed 값을 사용하도록 변경하여 해결했습니다.

netlify[bot] commented 1 year ago

Deploy request for ara-beta-dev pending review.

Visit the deploys page to approve it

Name Link
Latest commit 31d3e259b2bff36ba31485a637b899173e79f34d