Skip to content

Commit

Permalink
Fix : recommenderCount 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
bagger3025 committed Oct 29, 2022
1 parent 972caa7 commit 2ea4741
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/src/models/Post.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export default class Post {
*/
static async getAllBoards({ categoryKey }) {
let sql = `
SELECT p.postKey, p.userKey, p.categoryKey, c.categoryName, p.postTime, p.title, p.body, p.viewCount, count(*) as recommend
SELECT p.postKey, p.userKey, p.categoryKey, c.categoryName, p.postTime, p.title, p.body, p.viewCount
FROM Post as p
LEFT JOIN Category as c ON c.categoryKey=p.categoryKey
LEFT OUTER JOIN Recommenders as r ON r.postkey=p.postKey
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/board/board-id/BoardWriteView.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function ContentRow({ article }) {
<td className="writeUser content">{articleUser}</td>
<td className="time content gray">{displayedAt(article.postTime)}</td>
<td className="viewCount content gray">{article.viewCount}</td>
<td className="heart content gray">{article.recommend}</td>
<td className="heart content gray">{article.recommenderCount}</td>
<style jsx>{`
.title.content:after {
content: "[${article.comments.length}]";
Expand Down

1 comment on commit 2ea4741

@bagger3025
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.