inflearn logo
Khóa học

Khóa học

Chia sẻ kiến thức

Bài viết của epsozk22765

epsozk22765 epsozk22765

@epsozk22765

Số lượng đánh giá đã viết
2
Xếp hạng trung bình
5.0

Bài viết 21

Hỏi & Đáp

질문입니다.

오타군요ㅠㅠㅠㅠ 감사합니다ㅠㅠ 잘 친다고 쳤는데ㅠㅠ 정말 감사합니다

Lượt thích
0
Số bình luận
6
Lượt xem
5231

Hỏi & Đáp

질문입니다.

저 완전히 똑같은 오류인데 어떻게 해결 할 수 있을까요? 제로초님 말씀대로 이 부분에서 ...이 에러가 맞는데 해결방법을 모르겠습니다ㅠㅠ post.Comments가 undefined가 나와요ㅠㅠ 참고로 디비 확인했을때 댓글들이 잘 들어가 있습니다 const Comments = [ ... post . Comments , action . data . comment ];

Lượt thích
0
Số bình luận
6
Lượt xem
5231

Hỏi & Đáp

포스트가 존재하지 않습니다 에러가 납니다ㅠㅜㅠ

콘솔창에러메세지와 POST http://localhost:3065/api/post/$%7Bdata.postId%7D/comment 404 (Not Found) 코드입니다 router . post ( '/:id/comment' , async ( req , res , next ) => { try { if ( ! req .user) { return res . status ( 401 ). send ( '로그인이 필요합니다.' ) ; } const post = await db . Post . findOne ( { where : { id : req . params . id } } ) ; if ( ! post) { return res . status ( 404 ). send ( '포스트가 존재하지 않습니다.' ) ; } const newComment = await db . Comment . create ( { PostId : post . id , UserId : req . user . id , content : req . body . content , } ) ; await post . addComment ( newComment . id ) ; const comment = await db . Comment . findOne ( { where : { id : newComment . id , } , include :[ { model : db .User, attributes :[ 'id' , 'nickname' ], } ], } ) ; return res . json (comment) ; } catch (e) { console . error (e) ; return next (e) ; } } ) ; network의 response 메세지 입니다 포스트가 존재하지 않습니다.

Lượt thích
0
Số bình luận
5
Lượt xem
381

Hỏi & Đáp

콘솔에러가 나요ㅠㅠ

맞는 것 같아요... ---> index.js:1 Warning: Failed prop type: Invalid prop `post.createdAt` of type `string` supplied to `PostCard`, expected `object`. in PostCard (at pages/index.js:23) ---> index.js:1 Warning: Encountered two children with the same key, `[object Object]`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version. PostCard .propTypes = { post : PropTypes . shape ( { User : PropTypes . object , content : PropTypes .string, img : PropTypes .string, createdAt : PropTypes . object , } ), };

Lượt thích
0
Số bình luận
5
Lượt xem
361

Hỏi & Đáp

콘솔에러가 나요ㅠㅠ

createdAt 2020-04-12T08:32:59.000Z PostCard.js:39 createdAt 2020-04-12T08:32:01.000Z PostCard.js:39 createdAt 2020-04-10T07:20:10.000Z PostCard.js:39 createdAt 2020-04-10T07:20:00.000Z PostCard.js:39 createdAt 2020-04-10T07:04:42.000Z 전부 다른 값이 나옵니다. 그리고 post.id로 했는데도 같은 에러가 나요ㅠㅠ Warning: Encountered two children with the same key, `[object Object]`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version. Card key = { + post . id } cover = { post .img && img alt = "example" src = { post .img} /> } actions = {[

Lượt thích
0
Số bình luận
5
Lượt xem
361

Hỏi & Đáp

안녕하세요 제로초님 오류가 해결이 안되요ㅠㅠ

createdAt과 updatedAt에 now()를 주어서 해결했습니다 감사합니다! 그런데 로그인 비밀번호가 틀려서 로그인이 안됩니다ㅠㅠ 제 터미널 창입니다 [ qq qq false null undefined { reason: '비밀번호가 틀립니다.' } POST /api/user/login 401 95.666 ms - 29 ] 이건 제 소스코드 입니다 무엇이 문제일까요 터미널에서는 password =qq, user.password=qq 로 같은 값인것을 확인하였지만 result값은 false가 됩니다ㅠㅠ try { const user = await db . User . findOne ( { where : { userId } } ) ; if ( ! user) { return done ( null , false , { reason : '존재하지 않는 사용자입니다!' } ) ; } const result = await bcrypt . compare (password, user .password) ; console . log (password, user .password) ; console . log (result) ; if (result) { return done ( null , user) ; } return done ( null , false , { reason : '비밀번호가 틀립니다.' } ) ;

Lượt thích
0
Số bình luận
9
Lượt xem
435