| 107 | } |
| 108 | |
| 109 | async function seedContent() { |
| 110 | const folderData = { |
| 111 | type: 'folder', |
| 112 | title: 'week 1', |
| 113 | hidden: false, |
| 114 | thumbnail: |
| 115 | 'https://appx-recordings.s3.ap-south-1.amazonaws.com/drm/100x/images/week-1.jpg', |
| 116 | commentsCount: 0, |
| 117 | }; |
| 118 | |
| 119 | try { |
| 120 | const createdFolder = await db.content.create({ data: folderData }); |
| 121 | console.log('Created folder:', createdFolder); |
| 122 | const folderId = createdFolder.id; |
| 123 | |
| 124 | const contentData = [ |
| 125 | { |
| 126 | type: 'notion', |
| 127 | title: 'Notes for week 1', |
| 128 | hidden: false, |
| 129 | thumbnail: |
| 130 | 'https://appx-recordings.s3.ap-south-1.amazonaws.com/drm/100x/images/notes.png', |
| 131 | parentId: folderId, |
| 132 | commentsCount: 0, |
| 133 | }, |
| 134 | { |
| 135 | type: 'video', |
| 136 | title: 'test video for week 1', |
| 137 | hidden: false, |
| 138 | thumbnail: |
| 139 | 'https://appx-recordings.s3.ap-south-1.amazonaws.com/drm/100x/images/week-1-orientation.jpg', |
| 140 | parentId: folderId, |
| 141 | commentsCount: 0, |
| 142 | }, |
| 143 | ]; |
| 144 | |
| 145 | const createdContent = await db.content.createMany({ data: contentData }); |
| 146 | console.log('Created content:', createdContent); |
| 147 | } catch (error) { |
| 148 | console.error('Error seeding content:', error); |
| 149 | throw error; |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | async function seedCourseContent() { |
| 154 | try { |