fix: 修复 Vercel 部署时的 TypeScript 类型和 ESLint 错误
- 修复 prisma/seed.ts 中显式连接表的类型错误 - 将 webhook 路由中的 console.log 改为 console.warn - 添加非空断言修复 badges.ts 中的类型错误 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+18
-4
@@ -125,21 +125,35 @@ async function main() {
|
||||
const { tagSlugs, links, ...rest } = projectData
|
||||
const projectTags = tags.filter(t => tagSlugs.includes(t.slug))
|
||||
|
||||
await prisma.project.upsert({
|
||||
const project = await prisma.project.upsert({
|
||||
where: { slug: rest.slug },
|
||||
update: {},
|
||||
create: {
|
||||
...rest,
|
||||
status: ProjectStatus.ACTIVE,
|
||||
source: 'manual',
|
||||
tags: {
|
||||
connect: projectTags.map(t => ({ id: t.id }))
|
||||
},
|
||||
links: {
|
||||
create: links
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// Create ProjectTag connections manually since it's an explicit join table
|
||||
for (const tag of projectTags) {
|
||||
await prisma.projectTag.upsert({
|
||||
where: {
|
||||
projectId_tagId: {
|
||||
projectId: project.id,
|
||||
tagId: tag.id
|
||||
}
|
||||
},
|
||||
update: {},
|
||||
create: {
|
||||
projectId: project.id,
|
||||
tagId: tag.id
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`Created ${projects.length} projects`)
|
||||
|
||||
Reference in New Issue
Block a user