Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 課程列表 page 功能 #15

Merged
merged 2 commits into from
May 22, 2023

Conversation

ankazu
Copy link
Contributor

@ankazu ankazu commented May 21, 2023

page 設定,上限 20 筆資料

@ankazu ankazu requested a review from paperhsiaooo May 21, 2023 13:22
@ankazu ankazu changed the base branch from master to develop May 21, 2023 13:23
@ankazu ankazu requested review from paperhsiaooo and removed request for paperhsiaooo May 21, 2023 13:23
Comment on lines 9 to 13
const page = req.query.page || 1
const limit = 20
const offset = (page - 1) * limit

const courseData = await Course.findAndCountAll({
Copy link
Contributor

Choose a reason for hiding this comment

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

Limit 會是由前端送給後端
這樣當前端要改成單頁 10 筆時,後端也不用跟著動了
這部分可能再修正一下

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

})

const courses = courseData.map((course) => {
console.log(courseData.rows)
Copy link
Contributor

Choose a reason for hiding this comment

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

console.log 記得要移除唷!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已移除

Copy link
Contributor Author

@ankazu ankazu left a comment

Choose a reason for hiding this comment

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

修改回覆

Comment on lines 9 to 13
const page = req.query.page || 1
const limit = 20
const offset = (page - 1) * limit

const courseData = await Course.findAndCountAll({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

})

const courses = courseData.map((course) => {
console.log(courseData.rows)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

已移除

@ankazu ankazu requested a review from paperhsiaooo May 22, 2023 02:27
@paperhsiaooo
Copy link
Contributor

@ankazu 感謝 John,再麻煩合併至 dev branch 🙏

@ankazu ankazu merged commit d4272c6 into develop May 22, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants