fix: seed all gallery photos that exist on disk
Previous seed generated paths 0001-0018.jpg but only 0001-0010.jpg exist. Corrects to seed only 0001-0010.jpg and adds the extra photos (1-6.jpg, IMG_1615(1).jpg) so all 17 images appear on deploy.
This commit is contained in:
parent
a164c1f956
commit
b9c477cadf
1 changed files with 8 additions and 2 deletions
|
|
@ -46,8 +46,14 @@ async function seed() {
|
|||
// Gallery
|
||||
const galleryCount = await GalleryItem.countDocuments();
|
||||
if (galleryCount === 0) {
|
||||
const items = Array.from({ length: 18 }, (_, i) => ({
|
||||
imageUrl: `/photos/${String(i + 1).padStart(4, '0')}.jpg`,
|
||||
const photoPaths = [
|
||||
...Array.from({ length: 10 }, (_, i) => `/photos/${String(i + 1).padStart(4, '0')}.jpg`),
|
||||
'/photos/1.jpg', '/photos/2.jpg', '/photos/3.jpg',
|
||||
'/photos/4.jpg', '/photos/5.jpg', '/photos/6.jpg',
|
||||
'/photos/IMG_1615(1).jpg',
|
||||
];
|
||||
const items = photoPaths.map((imageUrl, i) => ({
|
||||
imageUrl,
|
||||
alt: 'MCDi community event photo',
|
||||
order: i,
|
||||
}));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue