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,37 @@
import prisma from "~/server/utils/prisma";
export default defineEventHandler(async (event) => {
try {
// Fetch notification categories from the database
const categories = await prisma.notification_categories.findMany({
select: {
name: true,
value: true,
description: true,
},
orderBy: {
name: 'asc'
}
});
// Transform the data to match the expected format
const formattedCategories = categories.map(category => ({
label: category.name,
value: category.value,
description: category.description
}));
return {
success: true,
data: formattedCategories
}
} catch (error) {
console.error('Error fetching categories:', error)
throw createError({
statusCode: 500,
statusMessage: 'Failed to fetch categories'
})
} finally {
// Disconnect Prisma client to avoid connection leaks
}
})