diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index b487a9c..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,66 +0,0 @@ -# Changelog - -All notable changes to PicPeak will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [Unreleased] - -### Added -- Gitea workflows for selective GitHub mirroring -- Password visibility toggle on event creation form -- Translation for password requirement errors - -### Changed -- Relaxed password requirements from 12 to 8 characters minimum -- Made special characters optional for gallery passwords -- Improved password strength requirements for better usability - -### Fixed -- Production deployment issues with Traefik routing -- Database migration failures for email_queue table -- JSON parsing errors in production environment -- PostgreSQL compatibility issues -- Connection stability in production - -## [1.0.22] - 2024-01-14 - -### Added -- Comprehensive error boundaries for better error handling -- Skeleton loading screens for improved perceived performance -- Offline indicator for network status -- Keyboard navigation support in gallery lightbox -- Skip links for accessibility -- Focus trap management for modals - -### Changed -- Improved accessibility to WCAG 2.1 AA compliance -- Enhanced loading states with skeleton screens -- Better error recovery with component-level boundaries - -### Fixed -- Missing translations in German locale -- Session timeout caching issues -- Email template JSON parsing errors - -## [1.0.0] - 2024-01-01 - -### Added -- Initial release of PicPeak -- Photo gallery management system -- Automatic file watching and gallery creation -- Password-protected galleries -- Expiration system with email notifications -- Admin dashboard with analytics -- Multi-language support (EN, DE) -- Docker deployment support -- Email template customization -- User upload functionality -- Bulk download features -- Mobile-responsive design -- Theme customization options - -[Unreleased]: https://github.com/the-luap/picpeak/compare/v1.0.22...HEAD -[1.0.22]: https://github.com/the-luap/picpeak/compare/v1.0.0...v1.0.22 -[1.0.0]: https://github.com/the-luap/picpeak/releases/tag/v1.0.0 \ No newline at end of file diff --git a/backend/src/routes/adminCategories.js b/backend/src/routes/adminCategories.js index 82dc1e3..a2efd14 100644 --- a/backend/src/routes/adminCategories.js +++ b/backend/src/routes/adminCategories.js @@ -77,12 +77,14 @@ router.post('/', adminAuth, [ } // Create category - const [categoryId] = await db('photo_categories').insert({ + const insertResult = await db('photo_categories').insert({ name, slug: categorySlug, is_global, event_id: is_global ? null : event_id - }); + }).returning('id'); + + const categoryId = insertResult[0]?.id || insertResult[0]; const category = await db('photo_categories').where('id', categoryId).first(); diff --git a/backend/src/routes/adminEvents.js b/backend/src/routes/adminEvents.js index dd3eb11..6ff5ec5 100644 --- a/backend/src/routes/adminEvents.js +++ b/backend/src/routes/adminEvents.js @@ -92,7 +92,7 @@ router.post('/', adminAuth, [ await fs.mkdir(path.join(eventPath, 'individual'), { recursive: true }); // Insert into database - const [eventId] = await db('events').insert({ + const insertResult = await db('events').insert({ slug, event_type, event_name, @@ -108,7 +108,10 @@ router.post('/', adminAuth, [ created_at: new Date().toISOString(), allow_user_uploads, upload_category_id - }); + }).returning('id'); + + // Handle both PostgreSQL (returns array of objects) and SQLite (returns array of IDs) + const eventId = insertResult[0]?.id || insertResult[0]; // Log activity await logActivity('event_created', @@ -133,7 +136,9 @@ router.post('/', adminAuth, [ gallery_password: password, expiry_date: await formatDate(expires_at, emailLang), welcome_message: welcome_message || '' - }) + }), + status: 'pending', + created_at: new Date() // scheduled_at will use default value });