epsozk22765
@epsozk22765
Reviews Written
2
Average Rating
5.0
Posts
Q&A
์ง๋ฌธ์ ๋๋ค.
์คํ๊ตฐ์ใ ใ ใ ใ ๊ฐ์ฌํฉ๋๋คใ ใ ์ ์น๋ค๊ณ ์ณค๋๋ฐใ ใ ์ ๋ง ๊ฐ์ฌํฉ๋๋ค
- 0
- 6
- 5.2K
Q&A
์ง๋ฌธ์ ๋๋ค.
์ ์์ ํ ๋๊ฐ์ ์ค๋ฅ์ธ๋ฐ ์ด๋ป๊ฒ ํด๊ฒฐ ํ ์ ์์๊น์? ์ ๋ก์ด๋ ๋ง์๋๋ก ์ด ๋ถ๋ถ์์ ...์ด ์๋ฌ๊ฐ ๋ง๋๋ฐ ํด๊ฒฐ๋ฐฉ๋ฒ์ ๋ชจ๋ฅด๊ฒ ์ต๋๋คใ ใ post.Comments๊ฐ undefined๊ฐ ๋์์ใ ใ ์ฐธ๊ณ ๋ก ๋๋น ํ์ธํ์๋ ๋๊ธ๋ค์ด ์ ๋ค์ด๊ฐ ์์ต๋๋ค const Comments = [...post.Comments, action.data.comment];
- 0
- 6
- 5.2K
Q&A
ํฌ์คํธ๊ฐ ์กด์ฌํ์ง ์์ต๋๋ค ์๋ฌ๊ฐ ๋ฉ๋๋คใ ใ ใ
ํด๊ฒฐ๋์์ด์!! ๊ฐ์ฌํฉ๋๋ค!!!!
- 0
- 5
- 326
Q&A
ํฌ์คํธ๊ฐ ์กด์ฌํ์ง ์์ต๋๋ค ์๋ฌ๊ฐ ๋ฉ๋๋คใ ใ ใ
if๋ฌธ์ ์ง์ฐ๊ณ ์คํํ๋๋ id ๊ฐ null์ด๋ผ๊ณ ๋์ต๋๋ค. ํน์ ๋๋น ์์ฒด์์ ๋ฌธ์ ๊ฐ ๋ฐ์ํ ๊ฑธ๊น์??
- 0
- 5
- 326
Q&A
ํฌ์คํธ๊ฐ ์กด์ฌํ์ง ์์ต๋๋ค ์๋ฌ๊ฐ ๋ฉ๋๋คใ ใ ใ
์ฝ์์ฐฝ์๋ฌ๋ฉ์ธ์ง์ 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
- 326
Q&A
์ฝ์์๋ฌ๊ฐ ๋์ใ ใ
๋ง๋ ๊ฒ ๊ฐ์์... ---> 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
- 324
Q&A
์ฝ์์๋ฌ๊ฐ ๋์ใ ใ
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
- 324
Q&A
์๋ ํ์ธ์ ์ ๋ก์ด๋ ์ค๋ฅ๊ฐ ํด๊ฒฐ์ด ์๋์ใ ใ
ํ ๋๋ฐ๋๋ฐ ์ ๊ฐ ํ์๊ฐ์ ์ ์ํด๋๊ณ ๋ก๊ทธ์ธ์ ํ๋ ค๊ณ ํ์ด์!! ๋ฐ๋ณด๋ฐ๋ณด ๊ฐ์ฌํฉ๋๋ค!!!!
- 0
- 9
- 376
Q&A
์๋ ํ์ธ์ ์ ๋ก์ด๋ ์ค๋ฅ๊ฐ ํด๊ฒฐ์ด ์๋์ใ ใ
์ ๊ฐ ์ํฌ๋ฒค์น์ ์์๋ก ๊ฐ์ ๋ฃ์๋๋ฐ ์ฝ๋์์ ๊ฐ์ ๋ฃ์ด์ฃผ๋ ๊ฑด๊ฐ์? ์ํธํ๋ฅผ ์ด๋ป๊ฒ ํ๋์ง ๋ชจ๋ฅด๊ฒ ์ด์..ใ ใ
- 0
- 9
- 376
Q&A
์๋ ํ์ธ์ ์ ๋ก์ด๋ ์ค๋ฅ๊ฐ ํด๊ฒฐ์ด ์๋์ใ ใ
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
- 376




