-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat (student): Implemented basic functionality to enroll courses
- Loading branch information
1 parent
632d632
commit 13069a3
Showing
4 changed files
with
27 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { db } from "~/server/db"; | ||
|
||
export async function GET(_request: Request) { | ||
const allCourses = await db.query.course.findMany(); | ||
|
||
return Response.json(allCourses, { status: 200 }); | ||
} |
14 changes: 14 additions & 0 deletions
14
apps/student/src/app/dashboard/courses/[id]/enroll-course-button.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
"use client"; | ||
|
||
import { GraduationCap } from "lucide-react"; | ||
|
||
import { Button } from "~/components/ui/button"; | ||
|
||
export const EnrollCourseButton = () => { | ||
return ( | ||
<Button onClick={() => console.log("Enrolled!")}> | ||
<GraduationCap className="mr-2 size-4" /> | ||
Enroll | ||
</Button> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters