Features added: - Database schema for pages and media files with content types (Rich Text, HTML, Markdown) - Admin API routes for full page CRUD operations - Image upload functionality with file management - Rich text editor using TinyMCE with image insertion - Admin interface for creating/editing pages with SEO options - Dynamic navigation and footer integration - Public page display routes with proper SEO metadata - Support for featured images and content excerpts Admin features: - Create/edit/delete pages with rich content editor - Upload and manage images through media library - Configure pages to appear in navigation or footer - Set page status (Draft, Published, Archived) - SEO title and description management - Real-time preview of content changes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
48 lines
1.2 KiB
TypeScript
48 lines
1.2 KiB
TypeScript
import dotenv from 'dotenv';
|
|
dotenv.config({ path: '.env.local' });
|
|
|
|
import { prisma } from '../lib/db';
|
|
|
|
async function checkAdminUser() {
|
|
try {
|
|
console.log('Checking admin user: andrei@cloudz.ro');
|
|
|
|
const user = await prisma.user.findUnique({
|
|
where: { email: 'andrei@cloudz.ro' },
|
|
select: {
|
|
id: true,
|
|
email: true,
|
|
name: true,
|
|
role: true,
|
|
createdAt: true,
|
|
lastLoginAt: true
|
|
}
|
|
});
|
|
|
|
if (user) {
|
|
console.log('✅ User found:', user);
|
|
|
|
if (['admin', 'moderator'].includes(user.role)) {
|
|
console.log('✅ User has admin privileges');
|
|
} else {
|
|
console.log('❌ User does not have admin role. Current role:', user.role);
|
|
console.log('Updating user role to admin...');
|
|
|
|
const updatedUser = await prisma.user.update({
|
|
where: { email: 'andrei@cloudz.ro' },
|
|
data: { role: 'admin' }
|
|
});
|
|
|
|
console.log('✅ User role updated:', updatedUser.role);
|
|
}
|
|
} else {
|
|
console.log('❌ User not found');
|
|
}
|
|
} catch (error) {
|
|
console.error('Error checking admin user:', error);
|
|
} finally {
|
|
await prisma.$disconnect();
|
|
}
|
|
}
|
|
|
|
checkAdminUser(); |