-
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.
DB Migration Stage:1 (new rating system)
- Loading branch information
1 parent
ac4790d
commit 5d6a339
Showing
13 changed files
with
392 additions
and
169 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,34 @@ | ||
"use server"; | ||
|
||
import { cookies } from "next/headers"; | ||
import prisma from "../../lib/prisma"; | ||
import { Prisma } from "@prisma/client"; | ||
import { auth } from "@/lib/auth"; | ||
import { getPlanCookie } from "./actions"; | ||
import { Faculty } from "@prisma/client"; | ||
|
||
export async function getProfs() { | ||
let profs: Faculty[] = []; | ||
let AllProfs = await prisma.faculty.findMany({ | ||
orderBy: { | ||
displayName: "desc", | ||
}, | ||
}); | ||
|
||
console.log(AllProfs.length); | ||
|
||
return AllProfs; | ||
} | ||
|
||
export async function getYears() { | ||
let years: any = []; | ||
let AllCourses = await prisma.course.findMany(); | ||
|
||
for (let i = 0; i < AllCourses.length; i++) { | ||
if (!years.includes(AllCourses[i].year)) { | ||
years.push(AllCourses[i].year); | ||
} | ||
} | ||
|
||
return years; | ||
} |
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
Oops, something went wrong.