Skip to content

Commit

Permalink
Fix font size
Browse files Browse the repository at this point in the history
  • Loading branch information
tanish35 committed Oct 30, 2024
1 parent 15afd89 commit 09e673e
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 8 deletions.
28 changes: 26 additions & 2 deletions backend/dist/controllers/userControllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const academic_email_verifier_1 = require("academic-email-verifier");
const checkAcademic_1 = __importDefault(require("../mail/checkAcademic"));
const registerSchema_1 = require("../validation/registerSchema");
const redis_1 = __importDefault(require("../lib/redis"));
const redis_2 = require("../lib/redis");
const axios_1 = __importDefault(require("axios"));
const googleSignInOrSignUp = (0, express_async_handler_1.default)(
//@ts-ignore
(req, res) => __awaiter(void 0, void 0, void 0, function* () {
Expand Down Expand Up @@ -125,12 +127,22 @@ const githubSignInOrSignUp = (0, express_async_handler_1.default)(
exports.githubSignInOrSignUp = githubSignInOrSignUp;
// @ts-ignore
const registerUser = (0, express_async_handler_1.default)((req, res) => __awaiter(void 0, void 0, void 0, function* () {
const { email, username, password, collegeName, courseName, isOnline, location, } = req.body;
const { email, username, password, collegeName, courseName, isOnline, location, captchaToken, } = req.body;
if (!process.env.SECRET) {
throw new Error("Secret not found");
}
const response = yield axios_1.default.post(`https://www.google.com/recaptcha/api/siteverify`, {}, {
params: {
secret: process.env.RECAPTCHA_SECRET_KEY,
response: captchaToken,
},
});
const { success } = response.data;
if (!success) {
return res.status(400).json({ error: "Invalid captcha" });
}
const hashedPassword = yield bcrypt_1.default.hash(password, 8);
if (!email || !username || !password) {
if (!email || !username || !password || !captchaToken) {
res.status(400).json({ message: "Please provide all fields" });
return;
}
Expand Down Expand Up @@ -632,7 +644,19 @@ const updateDetails = (0, express_async_handler_1.default)((req, res) => __await
pic,
},
});
const college = yield prisma_1.default.userCourse.findFirst({
where: {
user_id: userId,
},
select: {
college_id: true,
},
});
if (!college) {
return res.status(404).json({ message: "User not found" });
}
yield redis_1.default.del(`user:${userId}`);
yield (0, redis_2.deleteCachedPosts)(college.college_id);
return res.status(200).json({ message: "Details updated" });
}));
exports.updateDetails = updateDetails;
6 changes: 3 additions & 3 deletions backend/dist/lib/redis.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ const deleteCachedPosts = (collegeId) => __awaiter(void 0, void 0, void 0, funct
}
});
collegeStream.on("end", () => {
console.log(`Deleted cache for collegeId: ${collegeId}`);
// console.log(`Deleted cache for collegeId: ${collegeId}`);
});
allStream.on("end", () => {
console.log(`Deleted all cache entries.`);
// console.log(`Deleted all cache entries.`);
});
}
catch (error) {
console.error("Error deleting cached posts from Redis", error);
// console.error("Error deleting cached posts from Redis", error);
}
});
exports.deleteCachedPosts = deleteCachedPosts;
Expand Down
6 changes: 3 additions & 3 deletions backend/src/lib/redis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ export const deleteCachedPosts = async (collegeId: string): Promise<void> => {
}
});
collegeStream.on("end", () => {
console.log(`Deleted cache for collegeId: ${collegeId}`);
// console.log(`Deleted cache for collegeId: ${collegeId}`);
});

allStream.on("end", () => {
console.log(`Deleted all cache entries.`);
// console.log(`Deleted all cache entries.`);
});
} catch (error) {
console.error("Error deleting cached posts from Redis", error);
// console.error("Error deleting cached posts from Redis", error);
}
};

Expand Down
12 changes: 12 additions & 0 deletions frontend/src/styles/link.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,15 @@
.custom-link:hover {
text-decoration: underline;
}

.ql-size-huge {
font-size: 2.5em;
}

.ql-size-large {
font-size: 1.5em;
}

.ql-size-small {
font-size: 0.75em;
}

0 comments on commit 09e673e

Please sign in to comment.