Skip to content

Commit 302dd40

Browse files
committed
Fix: Migration errors
1 parent 02405d7 commit 302dd40

19 files changed

+46
-42
lines changed

backend/src/controllers/document.controller.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Router, Request, Response } from "express";
1+
import type { Router, Request, Response } from "express";
22
import { CreateDocumentSchema, UpdateDocumentSchema } from "../types";
33
import {
44
createDocument,
@@ -41,7 +41,7 @@ export const getDocumentsController = async (
4141
res: Response
4242
): Promise<void> => {
4343
try {
44-
const documents = await getDocuments(req.params.ownerId);
44+
const documents = await getDocuments(req.params.ownerId!);
4545
res.status(200).json({
4646
success: true,
4747
message: "Documents retrieved successfully",
@@ -63,7 +63,7 @@ export const updateDocumentController = async (
6363
try {
6464
const validatedData = UpdateDocumentSchema.parse(req.body);
6565
const document = await updateDocument(
66-
req.params.documentId,
66+
req.params.documentId!,
6767
validatedData.description ?? "",
6868
validatedData.name ?? "",
6969
validatedData.status ?? "",
@@ -89,7 +89,7 @@ export const deleteDocumentController = async (
8989
res: Response
9090
): Promise<void> => {
9191
try {
92-
await deleteDocument(req.params.documentId);
92+
await deleteDocument(req.params.documentId!);
9393
res.status(200).json({
9494
success: true,
9595
message: "Document deleted successfully",
@@ -108,7 +108,7 @@ export const getSingleDocumentController = async (
108108
res: Response
109109
): Promise<void> => {
110110
try {
111-
const document = await getSingleDocument(req.params.documentId);
111+
const document = await getSingleDocument(req.params.documentId!);
112112
res.status(200).json({
113113
success: true,
114114
message: "Document retrieved successfully",

backend/src/controllers/employee.controller.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
LoginSchema,
1919
UpdateEmployeeSchema,
2020
} from "../types";
21-
import { Request, Response } from "express";
21+
import type { Request, Response } from "express";
2222
import jwt from "jsonwebtoken";
2323

2424
// Environment variables should be properly set up
@@ -140,7 +140,7 @@ export const getEmployeesController = async (
140140
res: Response
141141
): Promise<void> => {
142142
try {
143-
var employees = await getEmployees(req.params.employerId);
143+
var employees = await getEmployees(req.params.employerId!);
144144
res.status(200).json({
145145
success: true,
146146
message: "Employees retrieved successfully",
@@ -160,7 +160,7 @@ export const getSingleEmployeeController = async (
160160
res: Response
161161
): Promise<void> => {
162162
try {
163-
const employee = await getSingleEmployee(req.params.employeeId);
163+
const employee = await getSingleEmployee(req.params.employeeId!);
164164
res.status(200).json({
165165
success: true,
166166
message: "Employee retrieved successfully",
@@ -180,7 +180,7 @@ export const getEmployeeDashboardDataFun = async (
180180
res: Response
181181
): Promise<void> => {
182182
try {
183-
var employees = await getEmployeeDashboard(req.params.empolyeeId);
183+
var employees = await getEmployeeDashboard(req.params.empolyeeId!);
184184
res.status(200).json({
185185
success: true,
186186
message: "Employees retrieved successfully",
@@ -225,7 +225,7 @@ export const updateEmployeeController = async (
225225
try {
226226
const validatedData = UpdateEmployeeSchema.parse(req.body);
227227
const employee = await updateEmployee(
228-
req.params.employeeId,
228+
req.params.employeeId!,
229229
validatedData.name ?? "",
230230
validatedData.email ?? "",
231231
validatedData.contact ?? "",
@@ -254,7 +254,7 @@ export const deleteEmployeeController = async (
254254
res: Response
255255
): Promise<void> => {
256256
try {
257-
await deleteEmployee(req.params.employeeId);
257+
await deleteEmployee(req.params.employeeId!);
258258
res.status(200).json({
259259
success: true,
260260
message: "Employee deleted successfully",

backend/src/controllers/payment.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Request, Response } from "express";
1+
import type { Request, Response } from "express";
22
import {
33
cancelSubscriptionService,
44
createSubscriptionService,

backend/src/controllers/project.controller.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Request, Response } from "express";
1+
import type { Request, Response } from "express";
22
import {
33
createProject,
44
getSingleProject,
@@ -235,7 +235,7 @@ export const getProjectsController = async (
235235
res: Response
236236
): Promise<void> => {
237237
try {
238-
const projects = await getProjects(req.params.ownerId);
238+
const projects = await getProjects(req.params.ownerId!);
239239
res.status(200).json({
240240
success: true,
241241
message: "Projects retrieved successfully",
@@ -255,7 +255,7 @@ export const getDashboardDataFun = async (
255255
res: Response
256256
): Promise<void> => {
257257
try {
258-
const projects = await getDashboardData(req.params.ownerId);
258+
const projects = await getDashboardData(req.params.ownerId!);
259259
res.status(200).json({
260260
success: true,
261261
message: "Projects retrieved successfully",
@@ -285,7 +285,7 @@ export const updateProjectController = async (
285285
}
286286

287287
const project = await updateProject(
288-
req.params.projectId,
288+
req.params.projectId!,
289289
name,
290290
ownerId,
291291
description ?? ""
@@ -309,7 +309,7 @@ export const getProjectController = async (
309309
res: Response
310310
): Promise<void> => {
311311
try {
312-
const project = await getSingleProject(req.params.projectId);
312+
const project = await getSingleProject(req.params.projectId!);
313313
res.status(200).json({
314314
success: true,
315315
message: "Project retrieved successfully",
@@ -329,7 +329,7 @@ export const deleteProjectController = async (
329329
res: Response
330330
): Promise<void> => {
331331
try {
332-
await deleteProject(req.params.projectId);
332+
await deleteProject(req.params.projectId!);
333333
res.status(200).json({
334334
success: true,
335335
message: "Project deleted successfully",

backend/src/controllers/recording.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Request, Response } from "express";
1+
import type { Request, Response } from "express";
22
import { saveRecordingService } from "../services/recording.service";
33

44
interface RecordingRequest {

backend/src/controllers/research.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { searchInternet } from "../services/research.service";
2-
import { Request, Response } from "express";
2+
import type { Request, Response } from "express";
33

44
export const researchController = async (req: Request, res: Response) => {
55
try {

backend/src/controllers/task.controller.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Request, Response } from "express";
1+
import type { Request, Response } from "express";
22
import {
33
createTask,
44
deleteTask,
@@ -47,7 +47,7 @@ export const getTasksController = async (
4747
res: Response
4848
): Promise<void> => {
4949
try {
50-
const tasks = await getTasks(req.params.ownerId);
50+
const tasks = await getTasks(req.params.ownerId!);
5151
res.status(200).json({
5252
success: true,
5353
message: "Tasks retrieved successfully",
@@ -83,7 +83,7 @@ export const updateTaskController = async (
8383
}
8484

8585
const task = await updateTask(
86-
req.params.taskId,
86+
req.params.taskId!,
8787
req.body.name ?? "",
8888
req.body.description ?? "",
8989
req.body.tag ?? "",
@@ -110,7 +110,7 @@ export const getSingleTaskController = async (
110110
res: Response
111111
): Promise<void> => {
112112
try {
113-
const task = await getSingleTask(req.params.taskId);
113+
const task = await getSingleTask(req.params.taskId!);
114114
res.status(200).json({
115115
success: true,
116116
message: "Task retrieved successfully",
@@ -130,7 +130,7 @@ export const deleteTaskController = async (
130130
res: Response
131131
): Promise<void> => {
132132
try {
133-
await deleteTask(req.params.taskId);
133+
await deleteTask(req.params.taskId!);
134134
res.status(200).json({
135135
success: true,
136136
message: "Task deleted successfully",

backend/src/controllers/user.controller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Request, Response, NextFunction } from "express";
1+
import type { Request, Response, NextFunction } from "express";
22
import { createAdmin, login, findUserById } from "../services/user.service";
33
import { CreateAdminSchema, LoginSchema } from "../types";
44
import jwt from "jsonwebtoken";
@@ -216,7 +216,7 @@ export const getUserById = async (
216216
): Promise<void> => {
217217
try {
218218
const userId = req.params.id;
219-
const user = await findUserById(userId);
219+
const user = await findUserById(userId!);
220220

221221
if (!user) {
222222
res.status(404).json({

backend/src/middlewares/auth_middleware.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Request, Response, NextFunction } from "express";
1+
import type { Request, Response, NextFunction } from "express";
22
import jwt from "jsonwebtoken";
33
import { UnauthorizedError } from "../utils/custom_error";
44
import cookieParser from "cookie-parser";

backend/src/middlewares/error_handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Request, Response, NextFunction } from "express";
1+
import type { Request, Response, NextFunction } from "express";
22

33
export const errorHandler = (
44
err: Error,

0 commit comments

Comments
 (0)