javascaript
Javascript é uma linguagem capaz de desenvolver desde Páginas web até jogos
javascaript
Javascript é uma linguagem capaz de desenvolver desde Páginas web até jogos
javascripte
coursesRouter.get('/:id',expressAsyncHandler(async(req,res)=>{
const pageSize = 1;
const page = Number(req.query.pageNumber) || 1;
const courseId = req.params.id;
const course = await db('id').from('courses').where('id','=',courseId)
const courseName = course[0].name
const sections = await db('course_name').from('sections').where('course_name','=',courseName).limit(pageSize).offset(pageSize * (page - 1))
const count = await db('course_name').from('sections').count('sections')
console.log( Math.ceil( count[0]/pageSize));
res.send({sections , page, pages: Math.ceil( count[0]/pageSize)})
}))
javascaript
Javascript é uma linguagem capaz de desenvolver desde Páginas web até jogos
javascripte
coursesRouter.get('/:id',expressAsyncHandler(async(req,res)=>{
const pageSize = 1;
const page = Number(req.query.pageNumber) || 1;
const courseId = req.params.id;
const course = await db('id').from('courses').where('id','=',courseId)
const courseName = course[0].name
const sections = await db('course_name').from('sections').where('course_name','=',courseName).limit(pageSize).offset(pageSize * (page - 1))
const count = await db('course_name').from('sections').count('sections')
console.log( Math.ceil( count[0]/pageSize));
res.send({sections , page, pages: Math.ceil( count[0]/pageSize)})
}))
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us