File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,11 +44,11 @@ const page = async ({ params, searchParams }: URLProps) => {
4444 < Votes
4545 type = "Question"
4646 itemId = { JSON . stringify ( result . _id ) }
47- userId = { JSON . stringify ( mongoUser . _id ) }
47+ userId = { JSON . stringify ( mongoUser ? ._id ) }
4848 upvotes = { result . upvotes . length }
49- hasUpvoted = { result . upvotes . includes ( mongoUser . _id ) }
49+ hasUpvoted = { result . upvotes . includes ( mongoUser ? ._id ) }
5050 downvotes = { result . downvotes . length }
51- hasDownvoted = { result . downvotes . includes ( mongoUser . _id ) }
51+ hasDownvoted = { result . downvotes . includes ( mongoUser ? ._id ) }
5252 hasSaved = { mongoUser ?. saved . includes ( result . _id ) }
5353 />
5454 </ div >
@@ -95,7 +95,7 @@ const page = async ({ params, searchParams }: URLProps) => {
9595
9696 < AllAnswers
9797 questionId = { result . _id }
98- userId = { mongoUser . _id }
98+ userId = { mongoUser ? ._id }
9999 totalAnswers = { result . answers . length }
100100 filter = { searchParams . filter }
101101 page = { searchParams . page }
@@ -104,7 +104,7 @@ const page = async ({ params, searchParams }: URLProps) => {
104104 < Answer
105105 question = { result . content }
106106 questionId = { JSON . stringify ( result . _id ) }
107- author = { JSON . stringify ( mongoUser . _id ) }
107+ author = { JSON . stringify ( mongoUser ? ._id ) }
108108 />
109109 </ >
110110 ) ;
You can’t perform that action at this time.
0 commit comments