include์ง๋ฌธ์ด์
const fullPost = await Post.findOne({ where: { id: post.id, }, include: [ { model: User, // ๊ฒ์๊ธ ์์ฑ์ attributes: ["id", "nickname"], }, ], include์์ model User์๋ ์๋ง์ ์ ์ ๋ค์ด ์์ํ
๋ฐ ๊ทธ์ค์์ ์ด๋ป๊ฒ post.id์ ๊ดํ ๊ฒ์๊ธ์ ์์ฑํ User๋ฅผ ์ฐพ์ ์ ์๋ ๊ฒ์ธ์ง์ ๋ํ ์๋ฌธ์
๋๋ค. Post.associate๋ ์ฐ๊ด ๋์ด ์๋ ๊ฒ ๊ฐ์๋ฐ ์ ๋ชจ๋ฅด๊ฒ ์ต๋๋ค.