Skip to content

Commit 49e5c3c

Browse files
fix(build): type enrollments array in seed-test-data route
The two enrollment objects had different shapes (one with product_id, one without), producing a union type that .upsert() rejected as excess properties, failing the production build. Annotate the array with an explicit type where product_id is optional. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 8fee2d2 commit 49e5c3c

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

app/api/seed-test-data/route.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,13 @@ export async function POST() {
7070
})
7171

7272
// Step 4: Create enrollments
73-
const enrollments = [
73+
const enrollments: Array<{
74+
user_id: string
75+
course_id: number
76+
product_id?: string | null
77+
status: string
78+
enrolled_at: string
79+
}> = [
7480
{
7581
user_id: studentUserId,
7682
course_id: 1,

0 commit comments

Comments
 (0)