Update various configuration files, components, and assets; enhance notification system and API endpoints; improve documentation and styles across the application.

This commit is contained in:
Haqeem Solehan
2025-10-16 16:05:39 +08:00
commit b124ff8092
336 changed files with 94392 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
import prisma from "~/server/utils/prisma";
export default defineEventHandler(async (event) => {
try {
// Get current date and set to start of day
const today = new Date();
today.setHours(0, 0, 0, 0);
// Count pending jobs
const pending = await prisma.notification_queue.count({
where: {
status: "queued",
},
});
// Count completed jobs today
const completed = await prisma.notification_queue.count({
where: {
status: "completed",
updated_at: {
gte: today,
},
},
});
// Count failed jobs
const failed = await prisma.notification_queue.count({
where: {
status: "failed",
},
});
return {
success: true,
data: {
pending,
completed,
failed,
},
};
} catch (error) {
console.error("Error fetching queue stats:", error);
throw createError({
statusCode: 500,
statusMessage: "Failed to fetch queue statistics",
data: {
error: error.message,
},
});
} finally {
}
});