Skip to content

Commit 32f8813

Browse files
committed
Interview controller and services modified
1 parent edef97f commit 32f8813

5 files changed

Lines changed: 43 additions & 34 deletions

File tree

src/controllers/interview.controller.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Request, Response, NextFunction } from "express";
22
import * as interviewService from "../services/interview.service";
33
import { ApiError } from "../utils/apiError";
44

5-
export const getInterviews = async (req: Request, res: Response, next: NextFunction) => {
5+
export const getInterviews = async (req: Request, res: Response) => {
66
const interviews = await interviewService.getInterviews();
77

88
res.status(200).json({
@@ -11,7 +11,7 @@ export const getInterviews = async (req: Request, res: Response, next: NextFunct
1111
});
1212
};
1313

14-
export const getInterviewById = async (req: Request, res: Response, next: NextFunction) => {
14+
export const getInterviewById = async (req: Request, res: Response) => {
1515
const interviewId = parseInt(req.params.id);
1616

1717
if (!interviewId) {
@@ -31,7 +31,7 @@ export const getInterviewById = async (req: Request, res: Response, next: NextFu
3131
};
3232

3333

34-
export const createInterview = async (req: Request, res: Response, next: NextFunction) => {
34+
export const createInterview = async (req: Request, res: Response) => {
3535
const memberId = req.params.memberId;
3636

3737
if (!memberId) {
@@ -58,7 +58,7 @@ export const createInterview = async (req: Request, res: Response, next: NextFun
5858
});
5959
};
6060

61-
export const updateInterviewById = async (req: Request, res: Response, next: NextFunction) => {
61+
export const updateInterviewById = async (req: Request, res: Response) => {
6262
const interviewId = parseInt(req.params.id);
6363

6464
if (!interviewId) {
@@ -97,7 +97,7 @@ export const updateInterviewById = async (req: Request, res: Response, next: Nex
9797
};
9898

9999

100-
export const deleteInterviewById = async (req: Request, res: Response, next: NextFunction) => {
100+
export const deleteInterviewById = async (req: Request, res: Response) => {
101101
const interviewId = parseInt(req.params.id);
102102

103103
if (!interviewId) {

src/services/interview.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { prisma } from "../db/client"
2-
import { InterviewCreateInput, InterviewUpdateInput } from "../types/interview.types";
2+
// import { InterviewCreateInput, InterviewUpdateInput } from "../types/interview.types";
33

44
export const getInterviews = async () => {
55
return await prisma.interviewExperience.findMany({

src/types/express.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ declare global {
1818
supabase?: SupabaseClient;
1919

2020
projectId ?: string;
21+
22+
achievementId ?: string;
2123

2224
}
2325
}

src/types/interview.d.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import 'express';
2+
export { }
3+
4+
declare global {
5+
interface InterviewResponse {
6+
id: number;
7+
company: string;
8+
role: string;
9+
verdict: "Selected" | "Rejected" | "Pending";
10+
content: string;
11+
isAnonymous: boolean;
12+
memberId: string;
13+
}
14+
15+
interface InterviewCreateInput {
16+
company: string;
17+
role: string;
18+
verdict: "Selected" | "Rejected" | "Pending";
19+
content: string;
20+
isAnonymous: boolean;
21+
}
22+
23+
interface InterviewUpdateInput {
24+
company?: string;
25+
role?: string;
26+
verdict?: "Selected" | "Rejected" | "Pending";
27+
content?: string;
28+
isAnonymous?: boolean;
29+
memberId: string; // For verification, not stored again in Prisma
30+
}
31+
32+
}
33+
34+
35+

src/types/interview.types.ts

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)