-
Notifications
You must be signed in to change notification settings - Fork 5
Add Interview Filters #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,10 +1,16 @@ | ||||||||||||||||||
| import { prisma } from "../db/client" | ||||||||||||||||||
|
|
||||||||||||||||||
| export const getInterviews = async (page: number = 1, limit: number = 10) => { | ||||||||||||||||||
| export const getInterviews = async (page: number = 1, limit: number = 10, verdict : string = "All") => { | ||||||||||||||||||
| const skip = (page - 1) * limit; | ||||||||||||||||||
|
|
||||||||||||||||||
| const where : any = {} | ||||||||||||||||||
| if(verdict !== "All"){ | ||||||||||||||||||
| where.verdict = verdict | ||||||||||||||||||
| } | ||||||||||||||||||
|
Comment on lines
+6
to
+9
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replace Using Apply this diff to use proper typing: -const where : any = {}
+const where: Prisma.InterviewExperienceWhereInput = {}
if(verdict !== "All"){
where.verdict = verdict
}You'll need to import the Prisma namespace at the top of the file: -import { prisma } from "../db/client"
+import { prisma, Prisma } from "../db/client"📝 Committable suggestion
Suggested change
🧰 Tools🪛 ESLint[error] 6-6: Unexpected any. Specify a different type. (@typescript-eslint/no-explicit-any) 🤖 Prompt for AI Agents |
||||||||||||||||||
|
|
||||||||||||||||||
| const [interviews, total] = await Promise.all([ | ||||||||||||||||||
| prisma.interviewExperience.findMany({ | ||||||||||||||||||
| where, | ||||||||||||||||||
| skip, | ||||||||||||||||||
| take: limit, | ||||||||||||||||||
| include: { | ||||||||||||||||||
|
|
@@ -21,7 +27,7 @@ export const getInterviews = async (page: number = 1, limit: number = 10) => { | |||||||||||||||||
| }, | ||||||||||||||||||
| }), | ||||||||||||||||||
|
|
||||||||||||||||||
| prisma.interviewExperience.count(), | ||||||||||||||||||
| prisma.interviewExperience.count({where}), | ||||||||||||||||||
| ]); | ||||||||||||||||||
|
|
||||||||||||||||||
| const formattedInterviews = interviews.map( | ||||||||||||||||||
|
|
||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.