게시글
질문&답변
2020.04.18
질문입니다.
오타군요ㅠㅠㅠㅠ 감사합니다ㅠㅠ 잘 친다고 쳤는데ㅠㅠ 정말 감사합니다
- 0
- 6
- 4.9K
질문&답변
2020.04.17
질문입니다.
저 완전히 똑같은 오류인데 어떻게 해결 할 수 있을까요? 제로초님 말씀대로 이 부분에서 ...이 에러가 맞는데 해결방법을 모르겠습니다ㅠㅠ post.Comments가 undefined가 나와요ㅠㅠ 참고로 디비 확인했을때 댓글들이 잘 들어가 있습니다 const Comments = [ ... post . Comments , action . data . comment ];
- 0
- 6
- 4.9K
질문&답변
2020.04.17
포스트가 존재하지 않습니다 에러가 납니다ㅠㅜㅠ
해결되었어요!! 감사합니다!!!!
- 0
- 5
- 134
질문&답변
2020.04.17
포스트가 존재하지 않습니다 에러가 납니다ㅠㅜㅠ
if문을 지우고 실행했더니 id 가 null이라고 나옵니다. 혹시 디비 자체에서 문제가 발생한 걸까요??
- 0
- 5
- 134
질문&답변
2020.04.17
포스트가 존재하지 않습니다 에러가 납니다ㅠㅜㅠ
콘솔창에러메세지와 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 메세지 입니다 포스트가 존재하지 않습니다.
- 0
- 5
- 134
질문&답변
2020.04.17
콘솔에러가 나요ㅠㅠ
맞는 것 같아요... ---> 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 , } ), };
- 0
- 5
- 166
질문&답변
2020.04.16
콘솔에러가 나요ㅠㅠ
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 = {[
- 0
- 5
- 166
질문&답변
2020.04.09
안녕하세요 제로초님 오류가 해결이 안되요ㅠㅠ
헐 대박대박 제가 회원가입을 안해놓고 로그인을 하려고 했어요!! 바보바보 감사합니다!!!!
- 0
- 9
- 189
질문&답변
2020.04.09
안녕하세요 제로초님 오류가 해결이 안되요ㅠㅠ
제가 워크벤치에 임의로 값을 넣었는데 코드에서 값을 넣어주는 건가요? 암호화를 어떻게 하는지 모르겠어요..ㅜㅜ
- 0
- 9
- 189
질문&답변
2020.04.09
안녕하세요 제로초님 오류가 해결이 안되요ㅠㅠ
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 : '비밀번호가 틀립니다.' } ) ;
- 0
- 9
- 189