From 1693a51b3e54a753511bd8b91dd2ae1dfbf8d711 Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Sun, 3 Aug 2025 01:01:06 +0200 Subject: [PATCH] Fix linting --- app/api/user/update-profile/route.ts | 6 ++++-- app/complete-profile/page.tsx | 4 ++-- components/ui/PromptAnswer.tsx | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/api/user/update-profile/route.ts b/app/api/user/update-profile/route.ts index 0f2b8bf2..9a26d8e1 100644 --- a/app/api/user/update-profile/route.ts +++ b/app/api/user/update-profile/route.ts @@ -64,7 +64,7 @@ export async function POST(req: Request) { }, }); - const modelMap = { + const modelMap: any = { interest: prisma.interest, profileInterest: prisma.profileInterest, connection: prisma.connection, @@ -75,7 +75,9 @@ export async function POST(req: Request) { profileCauseArea: prisma.profileCauseArea, } as const; - async function handleFeatures(features, attribute: string, profileAttribute: string, idName: string) { + type ModelKey = keyof typeof modelMap; + + async function handleFeatures(features: any, attribute: ModelKey, profileAttribute: string, idName: string) { // Add new features if (features.length > 0 && updatedUser.profile) { // First, find or create all features diff --git a/app/complete-profile/page.tsx b/app/complete-profile/page.tsx index 90102ef9..457c2cc2 100644 --- a/app/complete-profile/page.tsx +++ b/app/complete-profile/page.tsx @@ -96,7 +96,7 @@ function RegisterComponent() { setPersonalityType(profile.personalityType || null); setConflictStyle(profile.conflictStyle || ''); if (profile.promptAnswers) { - setPromptAnswers(Object.fromEntries(profile.promptAnswers.map(item => [item.prompt, item.answer]))); + setPromptAnswers(Object.fromEntries(profile.promptAnswers.map((item: Prompt) => [item.prompt, item.answer]))); } setIntroversion(profile.introversion || null); if (profile.birthYear) { @@ -267,7 +267,7 @@ function RegisterComponent() { console.log('submit image', key); console.log('submit images', keys); - const data = { + const data: any = { profile: { description, contactInfo, diff --git a/components/ui/PromptAnswer.tsx b/components/ui/PromptAnswer.tsx index 7126cfc1..c919c4c6 100644 --- a/components/ui/PromptAnswer.tsx +++ b/components/ui/PromptAnswer.tsx @@ -20,7 +20,7 @@ interface PromptAnswerProps { prompts: string[]; onAnswerChange: (answer: Answer) => void; initialAnswer?: string; - initialValues?; + initialValues?: any; initialPromptId?: string; className?: string; }