-
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.
Finish ratings, lint code, add basic splash page
- Loading branch information
1 parent
97c74bb
commit 67cf9c5
Showing
37 changed files
with
968 additions
and
390 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
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,6 @@ | ||
{ | ||
"endOfLint": "lf", | ||
"printWidhth": 80, | ||
"tabWidth": 2, | ||
"trailingComma": "es5" | ||
} |
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
This file was deleted.
Oops, something went wrong.
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,24 @@ | ||
import { Faculty } from "./../../../node_modules/.prisma/client/index.d"; | ||
import { NextResponse, NextRequest } from "next/server"; | ||
|
||
import prisma from "../../../lib/prisma"; | ||
|
||
export async function GET(request: NextRequest) { | ||
const { searchParams } = await new URL(request.url); | ||
const profID = parseInt((await searchParams.get("prof")) || "1"); | ||
|
||
const courses = await prisma.course.findMany({ | ||
include: { | ||
instructor: true, | ||
}, | ||
where: { | ||
instructor: { | ||
id: profID, | ||
}, | ||
}, | ||
}); | ||
|
||
//console.log(plans); | ||
console.log(courses); | ||
return NextResponse.json(courses, { status: 200 }); | ||
} |
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,9 @@ | ||
import { NextResponse, NextRequest } from "next/server"; | ||
|
||
import prisma from "../../../lib/prisma"; | ||
|
||
export async function GET(request: NextRequest) { | ||
const profs = await prisma.faculty.findMany({}); | ||
|
||
return NextResponse.json(profs, { status: 200 }); | ||
} |
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
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,39 @@ | ||
import { NextResponse, NextRequest } from "next/server"; | ||
|
||
import prisma from "../../../lib/prisma"; | ||
import { auth } from "../../../lib/auth"; | ||
|
||
export async function POST(request: NextRequest) { | ||
const data = await request.json(); | ||
const facultyID = parseInt(await data.facultyID); | ||
const courseID = parseInt(await data.courseID); | ||
|
||
const session = await auth(); | ||
|
||
//@ts-ignore | ||
const user = await prisma.user.findUnique({ | ||
where: { | ||
//@ts-ignore | ||
uuid: session?.user?.id, | ||
}, | ||
}); | ||
if (user?.id) { | ||
const newReview = await prisma.rating.create({ | ||
data: { | ||
userId: user?.id, | ||
courseID: courseID, | ||
facultyID: facultyID, | ||
overallRating: data.overallRating, | ||
difficulty: data.difficulty, | ||
takeAgain: data.takeAgain, | ||
forCredit: data.forCredit, | ||
grade: data.grade, | ||
review: data.review, | ||
}, | ||
}); | ||
return NextResponse.json(newReview, { status: 200 }); | ||
} | ||
|
||
//console.log(plans); | ||
return NextResponse.json("Submission Failed, no user", { status: 500 }); | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export default function DocsLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return ( | ||
<section className="flex flex-col items-center justify-center gap-4 max-h-[75vh] -mt-5 "> | ||
<div className="inline-block max-w-lg text-center justify-center overflow-scroll rounded-lg scrollbar-hide"> | ||
{children} | ||
</div> | ||
</section> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,3 +1,19 @@ | ||
export default async function LoginPage() { | ||
return <div className="">login</div>; | ||
"use client"; | ||
import { Card } from "@nextui-org/react"; | ||
import { title } from "../../components/primitives"; | ||
export default function LoginPage() { | ||
return ( | ||
<div className="w-5/6 justify-center text-center ml-auto mr-auto grid gap-10"> | ||
<div className="text-7xl">Welcome to the</div> | ||
<div className={title({ size: "lg", color: "logo" })}>SCCS</div> | ||
<div className={title({ size: "lg" })}>Course Planner </div> | ||
<div className={title({ size: "sm" })}>Version 2.0 </div> | ||
|
||
<div className="text-xl"> | ||
Please excuse us as we polish some remaining bugs, but feel free to | ||
explore and plan your classes! If you have suggestions or feedback, | ||
please email [email protected]. | ||
</div> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.