Skip to content

Commit 19f83e2

Browse files
committed
Percentages are correctly calculated. Closes #75
1 parent a5f491b commit 19f83e2

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

apps/nextjs/app/[lang]/[pathPrefix]/page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ export default function Page({ params }: PageProps) {
9797
return <div className="p-10 mt-10">Course not found.</div>
9898
}
9999

100+
debugger
100101
return (
101102
<div className="container mx-auto my-8 flex flex-col lg:flex-row justify-center gap-6 min-h-screen">
102103
<section className="flex flex-col items-center justify-center p-6 md:p-10 lg:p-12 lg:w-1/2 xl:w-3/5 bg-white rounded-2xl shadow">

apps/nextjs/app/api/courses-with-progress/route.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,17 @@ export async function GET(request: Request) {
3737
return NextResponse.json(coursesWithZeroProgress);
3838
}
3939

40+
console.log("OJO user.userId=", user.userId)
4041
const coursesWithProgress = await db
4142
.selectFrom('cor1440_gen_proyectofinanciero as p')
42-
.leftJoin('cor1440_gen_actividadpf as a', 'a.proyectofinanciero_id', 'p.id')
43+
.leftJoin('cor1440_gen_actividadpf as a',
44+
'a.proyectofinanciero_id', 'p.id')
4345
.leftJoin('guide_usuario as gu', (join) =>
4446
join.onRef('a.id', '=', 'gu.actividadpf_id')
4547
.on('gu.usuario_id', '=', user.userId)
4648
)
4749
.where('p.idioma', '=', lang)
48-
.where('p.conBilletera', '=', true)
50+
.where('a.sufijoRuta', '<>', '')
4951
.groupBy([
5052
'p.id',
5153
'p.titulo',
@@ -82,6 +84,7 @@ export async function GET(request: Request) {
8284
])
8385
.execute();
8486

87+
console.log("OJO coursesWithProgress=", coursesWithProgress)
8588
return NextResponse.json(coursesWithProgress);
8689

8790
} catch (error) {

apps/nextjs/lib/hooks/useGuideData.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ export function useGuideData({
9292
url += `&walletAddress=${session.address}&token=${csrfToken}`
9393
}
9494

95+
console.log("url=", url)
9596
const courseListResponse = await axios.get(url)
9697

9798
if (!courseListResponse.data || courseListResponse.data.length !== 1) {

0 commit comments

Comments
 (0)