Fix build errors: add missing Prisma models/fields and resolve TypeScript type errors
Schema: Add 11 new models (RoundTemplate, MentorNote, MentorMilestone, MentorMilestoneCompletion, EvaluationDiscussion, DiscussionComment, Message, MessageRecipient, MessageTemplate, Webhook, WebhookDelivery, DigestLog) and missing fields on existing models (Project.isDraft, ProjectFile.version, LiveVotingSession.allowAudienceVotes, User.digestFrequency, AuditLog.sessionId, MentorAssignment.completionStatus, etc). Add AUDIT_CONFIG/LOCALIZATION/DIGEST/ANALYTICS enum values. Code: Fix implicit any types, route type casts, enum casts, null safety, composite key handling, and relation field names across 11 source files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -674,7 +674,7 @@ export default function ApplySettingsPage() {
|
||||
toast.success('Loaded preset: MOPC Classic')
|
||||
return
|
||||
}
|
||||
const template = templates?.find((t) => t.id === value)
|
||||
const template = templates?.find((t: { id: string; name: string; config: unknown }) => t.id === value)
|
||||
if (template) {
|
||||
setConfig(template.config as WizardConfig)
|
||||
setIsDirty(true)
|
||||
@@ -692,7 +692,7 @@ export default function ApplySettingsPage() {
|
||||
</SelectItem>
|
||||
{templates && templates.length > 0 && (
|
||||
<>
|
||||
{templates.map((t) => (
|
||||
{templates.map((t: { id: string; name: string }) => (
|
||||
<SelectItem key={t.id} value={t.id}>
|
||||
{t.name}
|
||||
</SelectItem>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Suspense } from 'react'
|
||||
import Link from 'next/link'
|
||||
import type { Route } from 'next'
|
||||
import { prisma } from '@/lib/prisma'
|
||||
|
||||
export const dynamic = 'force-dynamic'
|
||||
@@ -148,7 +149,7 @@ async function ProgramsContent() {
|
||||
</Link>
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem asChild>
|
||||
<Link href={`/admin/programs/${program.id}/apply-settings`}>
|
||||
<Link href={`/admin/programs/${program.id}/apply-settings` as Route}>
|
||||
<Wand2 className="mr-2 h-4 w-4" />
|
||||
Apply Settings
|
||||
</Link>
|
||||
@@ -202,7 +203,7 @@ async function ProgramsContent() {
|
||||
</Link>
|
||||
</Button>
|
||||
<Button variant="outline" size="sm" className="flex-1" asChild>
|
||||
<Link href={`/admin/programs/${program.id}/apply-settings`}>
|
||||
<Link href={`/admin/programs/${program.id}/apply-settings` as Route}>
|
||||
<Wand2 className="mr-2 h-4 w-4" />
|
||||
Apply
|
||||
</Link>
|
||||
|
||||
@@ -197,7 +197,7 @@ export default function RoundTemplatesPage() {
|
||||
{/* Templates Grid */}
|
||||
{templates && templates.length > 0 ? (
|
||||
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
{templates.map((template) => {
|
||||
{templates.map((template: typeof templates[number]) => {
|
||||
const criteria = (template.criteriaJson as Array<unknown>) || []
|
||||
const hasSettings = template.settingsJson && Object.keys(template.settingsJson as object).length > 0
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ function CreateRoundContent() {
|
||||
|
||||
const loadTemplate = (templateId: string) => {
|
||||
if (!templateId || !templates) return
|
||||
const template = templates.find((t) => t.id === templateId)
|
||||
const template = templates.find((t: { id: string; name: string; roundType: string; settingsJson: unknown }) => t.id === templateId)
|
||||
if (!template) return
|
||||
|
||||
// Apply template settings
|
||||
@@ -207,7 +207,7 @@ function CreateRoundContent() {
|
||||
<SelectValue placeholder="Select a template..." />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{templates.map((t) => (
|
||||
{templates.map((t: { id: string; name: string; description?: string | null }) => (
|
||||
<SelectItem key={t.id} value={t.id}>
|
||||
{t.name}
|
||||
{t.description ? ` - ${t.description}` : ''}
|
||||
|
||||
Reference in New Issue
Block a user