Skip to content

Commit c8995d8

Browse files
Merge pull request #16 from abhitrueprogrammer/master
removed comments and deleted camera
2 parents f291da6 + c815454 commit c8995d8

File tree

16 files changed

+1
-115
lines changed

16 files changed

+1
-115
lines changed

src/app/adminupload/page.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ function Upload() {
5252
Authorization: `Bearer ${token}`,
5353
};
5454
if (!token) {
55-
console.error("Token not found in localStorage.");
5655
router.push("/papersadminlogin");
5756
}
5857
try {
@@ -86,7 +85,6 @@ function Upload() {
8685
event.preventDefault();
8786
const token = localStorage.getItem("token");
8887
if (!token) {
89-
console.error("Token not found in localStorage.");
9088
router.push("/papersadminlogin");
9189
return;
9290
}
@@ -145,7 +143,6 @@ function Upload() {
145143
) => {
146144
const token = localStorage.getItem("token");
147145
if (!token) {
148-
console.error("Token not found in localStorage.");
149146
router.push("/papersadminlogin");
150147
return;
151148
}
@@ -187,7 +184,6 @@ function Upload() {
187184
const handleDeletePdf = async () => {
188185
const token = localStorage.getItem("token");
189186
if (!token) {
190-
console.error("Token not found in localStorage.");
191187
router.push("/papersadminlogin");
192188
return;
193189
}
@@ -236,7 +232,6 @@ function Upload() {
236232

237233
const handleSubmitMerged = async (e: React.FormEvent) => {
238234
e.preventDefault();
239-
console.log(files);
240235
if (files.length === 0) {
241236
alert("Please upload at least one file");
242237
return;
@@ -358,7 +353,6 @@ function Upload() {
358353
async function completeUpload() {
359354
const token = localStorage.getItem("token");
360355
if (!token) {
361-
console.error("Token not found in localStorage.");
362356
router.push("/papersadminlogin");
363357
return;
364358
}

src/app/api/admin/route.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export async function POST(req: Request) {
2424
exam,
2525
});
2626
if (existingPaper) {
27-
console.log("Paper already exists:", existingPaper);
2827
NextResponse.json({ message: "Paper already exists" }, { status: 409 });
2928
}
3029
if (!isPdf) {
@@ -34,7 +33,6 @@ export async function POST(req: Request) {
3433
format: "pdf",
3534
density: 50,
3635
})) as ConverttoPDFResponse;
37-
console.log("Result:", response);
3836
finalUrl = response.url;
3937
const paper = new Paper({
4038
finalUrl,
@@ -44,15 +42,11 @@ export async function POST(req: Request) {
4442
exam,
4543
});
4644
await paper.save();
47-
console.log("Paper saved:", publicIds);
4845
await Promise.all(
4946
publicIds.map(async (public_id) => {
5047
const deletionResult =
5148
await cloudinary.v2.uploader.destroy(public_id);
52-
console.log(
53-
`Deleted asset with public_id ${public_id}`,
54-
deletionResult,
55-
);
49+
5650
}),
5751
);
5852
} else {
@@ -103,10 +97,8 @@ export async function DELETE(req: Request) {
10397
type: type,
10498
});
10599

106-
console.log("Deletion result:", deletionResult);
107100
return NextResponse.json({ message: "Asset deleted successfully" });
108101
} catch (error) {
109-
console.error("Error deleting asset:", error);
110102
return NextResponse.json(
111103
{ message: "Failed to delete asset", error },
112104
{ status: 500 },

src/app/api/admin/watermark/route.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ export async function DELETE(req: Request, res: NextApiResponse) {
9292
);
9393
}
9494
} catch (error) {
95-
console.error("Error deleting PDF file:", error);
9695
return NextResponse.json({
9796
error: "Failed to delete watermarked PDF file",
9897
}, { status: 500 });

src/app/api/auth/login/route.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,12 @@ export async function POST(req: Request) {
2323

2424
const token = await generateToken({ userId: user._id });
2525

26-
console.log("User logged in:", token);
2726

2827
return NextResponse.json({
2928
token,
3029
user: { id: user._id, email: user.email },
3130
}, { status: 200 });
3231
} catch (error) {
33-
console.error("Error logging in:", error);
3432
return NextResponse.json({ message: "Failed to login", error }, { status: 500 });
3533
}
3634
}

src/app/api/auth/signup/route.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export async function POST(req: Request) {
3030
user: { id: newUser._id, email: newUser.email },
3131
}, { status: 201 });
3232
} catch (error) {
33-
console.error("Error signing up:", error);
3433
return NextResponse.json({ message: "Failed to sign up", error }, { status: 500 });
3534
}
3635
}

src/app/api/mail/route.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ export async function POST(request: Request) {
114114

115115
return NextResponse.json({ message: "Email sent successfully!" }, { status: 200 });
116116
} catch (error) {
117-
console.error(error);
118117
return NextResponse.json(
119118
{ message: "Error sending email", error: error },
120119
{ status: 422 },

src/app/api/papers/route.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export async function GET(req: NextRequest) {
2525
const papers: IPaper[] = await Paper.find({
2626
subject: { $regex: new RegExp(`${escapedSubject}`, "i") },
2727
});
28-
console.log("Papers:", papers);
2928

3029
if (papers.length === 0) {
3130
return NextResponse.json(
@@ -43,7 +42,6 @@ export async function GET(req: NextRequest) {
4342
{ status: 200 }
4443
);
4544
} catch (error) {
46-
console.error("Error fetching papers by subject:", error);
4745
return NextResponse.json(
4846
{ message: "Failed to fetch papers", error },
4947
{ status: 500 }

src/app/api/search/route.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ export async function GET(req: Request) {
3232

3333
return NextResponse.json({ subjects }, { status: 200 });
3434
} catch (error) {
35-
console.error("Error fetching subjects:", error);
3635
return NextResponse.json(
3736
{ message: "Failed to fetch subjects", error },
3837
{ status: 500 }

src/app/papersadminlogin/page.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ const LoginPage = () => {
4949
}, 1500);
5050
}
5151
} catch (e) {
52-
console.log(e);
5352
}
5453
};
5554

src/app/upload/page.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ const Page = () => {
107107
}, 1500);
108108
}
109109
} catch (e) {
110-
console.log(e);
111110
}
112111
};
113112

0 commit comments

Comments
 (0)