Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
b6a2b4e
feat: Enhance text color for better readability in KYCContent and Bad…
renulucshmi Jul 15, 2025
80d31c1
Merge branch 'dev' of https://github.com/Code102SoftwareProject/skill…
renulucshmi Jul 15, 2025
455a320
feat: Add admin management features including create, edit, and filte…
renulucshmi Jul 16, 2025
30ef387
feat: Refactor SuspendedUsersContent component to improve structure a…
renulucshmi Jul 16, 2025
40d481a
feat: Refactor SuspendedUsersContent component for improved readabili…
renulucshmi Jul 16, 2025
078fc22
feat: Update AdminSidebar to use NotebookTabs icon for Forum Reports
renulucshmi Jul 16, 2025
fbade21
feat: Refactor reporting system with enhanced filtering and email han…
renulucshmi Jul 16, 2025
e52fa13
Merge branch 'dev' of https://github.com/Code102SoftwareProject/skill…
renulucshmi Jul 16, 2025
d32d239
feat: Add hasInstallScript property to package-lock.json
renulucshmi Jul 16, 2025
aec7399
Merge branch 'dev' of https://github.com/Code102SoftwareProject/skill…
renulucshmi Jul 16, 2025
d4127a9
feat: Add ReportDetailsModal component and enhance report filtering f…
renulucshmi Jul 16, 2025
c96d763
feat: Refactor ReportDetailsModal to use string constants for user-vi…
renulucshmi Jul 17, 2025
ef0cd49
feat: Remove "Engagement and Activity Badges" from badge categories a…
renulucshmi Jul 17, 2025
9057afe
Merge branch 'dev' of https://github.com/Code102SoftwareProject/skill…
renulucshmi Jul 17, 2025
f0f5ac6
feat: Enhance badge name validation to require a minimum length of 3 …
renulucshmi Jul 17, 2025
8924fa4
Merge branch 'dev' of https://github.com/Code102SoftwareProject/skill…
renulucshmi Jul 18, 2025
f8d71b3
chore: update next and related dependencies to version 15.4.1 and sha…
renulucshmi Jul 18, 2025
e9e43e1
Merge branch 'dev' of https://github.com/Code102SoftwareProject/skill…
renulucshmi Jul 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
570 changes: 491 additions & 79 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"mongodb": "^6.13.0",
"mongoose": "^8.10.1",
"natural": "^8.1.0",
"next": "^15.2.4",
"next": "^15.4.1",
"next-auth": "^4.24.11",
"next-connect": "^1.0.0",
"next-themes": "^0.4.4",
Expand Down
6 changes: 5 additions & 1 deletion src/app/api/admin/dashboard/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import Session from "@/lib/models/sessionSchema";
import SkillList from "@/lib/models/skillListing";
import SkillListing from "@/lib/models/skillListing";
import SkillMatch from "@/lib/models/skillMatch";
import SuspendedUser from "@/lib/models/suspendedUserSchema";
import { NextResponse } from "next/server";

export async function GET() {
try {
await connect(); // Connect to your MongoDB

const totalUsers = await User.countDocuments();
const totalUsers = await User.countDocuments({ isDeleted: false });
const sessions = await Session.countDocuments();
const skillsRequested = await SkillList.countDocuments();
const skillsOffered = await SkillListing.countDocuments();
Expand All @@ -20,6 +21,8 @@ export async function GET() {
const userIds = await Session.distinct("userId");
const activeUsers = userIds.length;

const suspendedUsers = await SuspendedUser.countDocuments();

const popularSkillDoc = await SkillList.aggregate([
{ $group: { _id: "$skillName", count: { $sum: 1 } } },
{ $sort: { count: -1 } },
Expand Down Expand Up @@ -88,6 +91,7 @@ export async function GET() {
totalUsers,
activeUsers,
sessions,
suspendedUsers,
popularSkill,
skillsOffered,
skillsRequested,
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/admin/reports/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export async function GET(req: Request) {
}

// Check if we can fetch without population first
const reportsBasic = await ReportInSession.find({}).limit(1);
const reportsBasic = await ReportInSession.find({}).limit(1).lean();
console.log(
"Basic report sample:",
JSON.stringify(reportsBasic[0], null, 2)
Expand Down
1 change: 0 additions & 1 deletion src/app/badge/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const CATEGORIES = [
"All",
"Achievement Milestone Badges",
"Specific Badges",
"Engagement and Activity Badges",
"Exclusive Recognition Badges",
];

Expand Down
3 changes: 2 additions & 1 deletion src/components/Admin/AdminSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
Shield,
Star,
UserX,
NotebookTabs,
} from "lucide-react";

import clsx from "clsx"; // Utility for conditional class names
Expand Down Expand Up @@ -88,7 +89,7 @@ const navItems = [
{
id: "forum-reports",
label: "Forum Reports",
icon: Flag,
icon: NotebookTabs,
permission: "manage_forum_reports",
},
];
Expand Down
Loading
Loading