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:
@@ -510,11 +510,11 @@ function MilestonesSection({
|
||||
}
|
||||
|
||||
const completedCount = milestones.filter(
|
||||
(m) => m.myCompletions.length > 0
|
||||
(m: { myCompletions: unknown[] }) => m.myCompletions.length > 0
|
||||
).length
|
||||
const totalRequired = milestones.filter((m) => m.isRequired).length
|
||||
const totalRequired = milestones.filter((m: { isRequired: boolean }) => m.isRequired).length
|
||||
const requiredCompleted = milestones.filter(
|
||||
(m) => m.isRequired && m.myCompletions.length > 0
|
||||
(m: { isRequired: boolean; myCompletions: unknown[] }) => m.isRequired && m.myCompletions.length > 0
|
||||
).length
|
||||
|
||||
const handleToggle = (milestoneId: string, isCompleted: boolean) => {
|
||||
@@ -545,7 +545,7 @@ function MilestonesSection({
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="space-y-3">
|
||||
{milestones.map((milestone) => {
|
||||
{milestones.map((milestone: { id: string; name: string; description: string | null; isRequired: boolean; myCompletions: { completedAt: Date }[] }) => {
|
||||
const isCompleted = milestone.myCompletions.length > 0
|
||||
const isPending = completeMutation.isPending || uncompleteMutation.isPending
|
||||
|
||||
@@ -752,7 +752,7 @@ function NotesSection({ mentorAssignmentId }: { mentorAssignmentId: string }) {
|
||||
</div>
|
||||
) : notes && notes.length > 0 ? (
|
||||
<div className="space-y-3">
|
||||
{notes.map((note) => (
|
||||
{notes.map((note: { id: string; content: string; isVisibleToAdmin: boolean; createdAt: Date }) => (
|
||||
<div
|
||||
key={note.id}
|
||||
className="p-4 rounded-lg border space-y-2"
|
||||
|
||||
Reference in New Issue
Block a user