Skip to content

Commit e594340

Browse files
fix: improve code formatting and consistency across multiple files
1 parent 3aecc51 commit e594340

File tree

6 files changed

+33
-24
lines changed

6 files changed

+33
-24
lines changed

src/db/papers.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ const adminSchema = new Schema<IAdminPaper>({
99
subject: { type: String, required: true, index: true },
1010
slot: { type: String, required: true },
1111
year: { type: String, required: true },
12-
exam: { type: String, enum: ["CAT-1", "CAT-2", "FAT","Model CAT-1" , "Model CAT-2" , "Model FAT"], required: true },
13-
semester:{ type: String, enum: ["Fall Semester" , "Winter Semester" , "Summer Semester", "Weekend Semester"], required: true },
14-
campus:{ type: String, enum: ["Vellore" ,"Chennai" , "Andhra Pradesh" ,"Bhopal" , "Bangalore" , "Mauritius"], required: true },
12+
exam: { type: String, enum: ["CAT-1", "CAT-2", "FAT", "Model CAT-1", "Model CAT-2", "Model FAT"], required: true },
13+
semester: { type: String, enum: ["Fall Semester", "Winter Semester", "Summer Semester", "Weekend Semester"], required: true },
14+
campus: { type: String, enum: ["Vellore", "Chennai", "Andhra Pradesh", "Bhopal", "Bangalore", "Mauritius"], required: true },
1515
answerKeyIncluded: { type: Boolean, default: false },
1616
isSelected: { type: Boolean, default: false },
1717
});
@@ -21,9 +21,9 @@ const paperSchema = new Schema<IPaper>({
2121
subject: { type: String, required: true, index: true },
2222
slot: { type: String, required: true },
2323
year: { type: String, required: true },
24-
exam: { type: String, enum: ["CAT-1", "CAT-2", "FAT","Model CAT-1" , "Model CAT-2" , "Model FAT"], required: true },
25-
semester:{ type: String, enum: ["Fall Semester" , "Winter Semester" , "Summer Semester", "Weekend Semester"], required: true },
26-
campus:{ type: String, enum: ["Vellore" ,"Chennai" , "Andhra Pradesh" ,"Bhopal" , "Bangalore" , "Mauritius"], required: true },
24+
exam: { type: String, enum: ["CAT-1", "CAT-2", "FAT", "Model CAT-1", "Model CAT-2", "Model FAT"], required: true },
25+
semester: { type: String, enum: ["Fall Semester", "Winter Semester", "Summer Semester", "Weekend Semester"], required: true },
26+
campus: { type: String, enum: ["Vellore", "Chennai", "Andhra Pradesh", "Bhopal", "Bangalore", "Mauritius"], required: true },
2727
answerKeyIncluded: { type: Boolean, default: false },
2828
});
2929

@@ -38,6 +38,6 @@ export const PaperAdmin: Model<IAdminPaper> =
3838
export const Course: Model<ICourses> =
3939
mongoose.models.Course ?? mongoose.model("Course", courseSchema);
4040
const Paper: Model<IPaper> =
41-
mongoose.models.Paper ?? mongoose.model<IPaper>("Paper", paperSchema);
41+
mongoose.models.Paper ?? mongoose.model<IPaper>("Paper", paperSchema);
4242

4343
export default Paper;

src/db/upcoming-slot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { type IUpcomingSlot } from "@/interface";
22
import mongoose, { Schema, type Model } from "mongoose";
33

44
const upcomingSlotSchema = new Schema<IUpcomingSlot>({
5-
slot: {type: String, required: true, unique: true},
5+
slot: { type: String, required: true, unique: true },
66
});
77

88
const UpcomingSlot: Model<IUpcomingSlot> =

src/styles/globals.css

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,75 +80,86 @@
8080

8181
@apply border-border;
8282
}
83+
8384
body {
8485
@apply bg-background text-foreground;
8586
}
8687
}
8788

88-
89-
9089
@font-face {
9190
font-family: "phonk";
9291
src: url(/phonkfont.otf);
9392
}
93+
9494
@font-face {
9595
font-family: "jost";
9696
src: url(/jostfont.ttf);
9797
}
98+
9899
@font-face {
99100
font-family: "vipna";
100101
src: url(/Vipnagorgialla.otf);
101102
}
103+
102104
@font-face {
103105
font-family: "vipnabd";
104106
src: url(/VipnagorgiallaBd.otf);
105107
}
108+
106109
@font-face {
107110
font-family: "play";
108111
src: url(/play.ttf);
109112
}
113+
110114
.jost {
111115
font-family: "jost";
112116
}
117+
113118
.phonk {
114119
font-family: "phonk";
115120
}
121+
116122
.vipna {
117123
font-family: "vipna";
118124
}
125+
119126
.vipnabd {
120127
font-family: "vipnabd";
121128
}
129+
122130
.play {
123131
font-family: "play";
124132
}
133+
125134
.dark ::-webkit-scrollbar {
126135
width: 0.4rem;
127136
height: 0.4rem;
128137
background: #535253;
129138
}
130139

131-
/* Track */
132140
.dark ::-webkit-scrollbar-track {
133141
background: #0c0c0c;
134142
border-radius: 0.6rem;
135143
z-index: -99;
136144
}
137-
/* Handle */
145+
138146
.dark ::-webkit-scrollbar-thumb {
139147
background: #5c5957;
140148
border-radius: 1rem;
141149
}
150+
142151
::-webkit-scrollbar {
143152
width: 0.4rem;
144153
height: 0.4rem;
145154
background: #535253;
146155
}
156+
147157
::-webkit-scrollbar-track {
148158
background: #ffffff;
149159
border-radius: 0.6rem;
150160
z-index: -99;
151161
}
162+
152163
::-webkit-scrollbar-thumb {
153164
background: #929292;
154165
border-radius: 1rem;
@@ -165,18 +176,21 @@
165176
font-style: normal;
166177
}
167178

168-
body{
179+
body {
169180
position: relative;
170181
}
171182

172183
@layer utilities {
184+
173185
/* Chrome, Safari and Opera */
174186
.no-scrollbar::-webkit-scrollbar {
175187
display: none;
176188
}
177189

178190
.no-scrollbar {
179-
-ms-overflow-style: none; /* IE and Edge */
180-
scrollbar-width: none; /* Firefox */
191+
-ms-overflow-style: none;
192+
/* IE and Edge */
193+
scrollbar-width: none;
194+
/* Firefox */
181195
}
182196
}

src/util/error.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ export function handleAPIError(err: unknown): ApiError {
1111
const msg = (data as { message: string })?.message;
1212

1313
if (msg) {
14-
1514
return new ApiError(response.status, toSentenceCase(msg));
1615
}
1716
}

src/util/gemini.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
import "@ungap/with-resolvers";
2-
32
import { GoogleGenAI } from "@google/genai";
43
import { type ExamDetail } from "@/interface";
54

6-
// Type definitions
7-
85
type AnalysisResult = {
96
examDetail: ExamDetail;
107
rawAnalysis: string;
118
};
129

13-
// Custom error type
1410
class ProcessingError extends Error {
1511
constructor(message: string) {
1612
super(message);
@@ -32,10 +28,10 @@ export default async function processAndAnalyze({
3228
}
3329
}
3430

35-
// Function to parse Gemini's response into ExamDetail format
31+
// Parse Gemini's response into the ExamDetail format
3632
function parseExamDetail(analysis: string): ExamDetail {
3733
try {
38-
// Try to find JSON in the response
34+
// Parse JSON from the response
3935
const jsonRegex = /\{[\s\S]*\}/;
4036
const jsonMatch = jsonRegex.exec(analysis);
4137
if (jsonMatch) {
@@ -76,7 +72,7 @@ function parseExamDetail(analysis: string): ExamDetail {
7672
}
7773
}
7874

79-
// Function to analyze images using Gemini AI
75+
// Analyze images using the Gemini AI
8076
async function analyzeImage(dataUrl: string): Promise<AnalysisResult[]> {
8177
try {
8278
const apiKey = process.env.GEMINI_API_KEY;

src/util/utils.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function toSentenceCase(input: string): string {
1616
export function extractBracketContent(subject: string): string | null {
1717
const regex = /\[(.*?)\]/;
1818
const match = regex.exec(subject);
19-
return match?.[1] ?? "BMAT102L"; //MAKE SURE IT WORKS WHEN URL IS DONE FROM BACKEND
19+
return match?.[1] ?? "BMAT102L"; // Make sure it works when URL is done from the backend
2020
}
2121

2222
export function extractWithoutBracketContent(subject: string): string {

0 commit comments

Comments
 (0)