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,54 @@
import prisma from "~/server/utils/prisma";
export default defineEventHandler(async (event) => {
try {
const user = event.context.user;
if (!user) {
throw createError({
statusCode: 401,
statusMessage: "Authentication required",
});
}
const smsConfig = await prisma.notification_delivery_config.findFirst({
where: { channel_type: 'sms' },
select: {
is_enabled: true,
provider: true,
provider_config: true,
status: true,
success_rate: true,
created_at: true,
updated_at: true
}
});
if (!smsConfig) {
return {
success: true,
data: {
enabled: false,
provider: 'twilio',
status: 'Not Configured',
successRate: 0
}
};
}
return {
success: true,
data: {
enabled: smsConfig.is_enabled,
provider: smsConfig.provider,
status: smsConfig.status,
successRate: smsConfig.success_rate,
config: smsConfig.provider_config
}
};
} catch (error) {
console.error('Error fetching SMS configuration:', error);
if (error.statusCode) throw error;
throw createError({
statusCode: 500,
statusMessage: 'Failed to fetch SMS configuration'
});
} finally {
}
});