fix(admin): remove revalidatePath to prevent combobox reset after save
revalidatePath was causing the server component to re-render and potentially remount the client component, resetting all useState values. Since the client component already updates its local state optimistically after save, revalidatePath is unnecessary here. Also uninstalls agentation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
'use server'
|
'use server'
|
||||||
|
|
||||||
import { revalidatePath } from 'next/cache'
|
|
||||||
import prisma from '@/lib/prisma'
|
import prisma from '@/lib/prisma'
|
||||||
import { auth } from '@/auth'
|
import { auth } from '@/auth'
|
||||||
import { sendEmail } from '@/lib/mail'
|
import { sendEmail } from '@/lib/mail'
|
||||||
@@ -57,7 +56,6 @@ export async function updateSystemConfig(data: Record<string, string>) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
await prisma.$transaction(operations)
|
await prisma.$transaction(operations)
|
||||||
revalidatePath('/admin/settings')
|
|
||||||
return { success: true }
|
return { success: true }
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to update settings:', error)
|
console.error('Failed to update settings:', error)
|
||||||
|
|||||||
20
keep-notes/package-lock.json
generated
20
keep-notes/package-lock.json
generated
@@ -71,7 +71,6 @@
|
|||||||
"@types/react": "^19",
|
"@types/react": "^19",
|
||||||
"@types/react-dom": "^19",
|
"@types/react-dom": "^19",
|
||||||
"@vitest/coverage-v8": "^4.0.18",
|
"@vitest/coverage-v8": "^4.0.18",
|
||||||
"agentation": "^3.0.2",
|
|
||||||
"prisma": "^5.22.0",
|
"prisma": "^5.22.0",
|
||||||
"tailwindcss": "^4.0.0",
|
"tailwindcss": "^4.0.0",
|
||||||
"tsx": "^4.21.0",
|
"tsx": "^4.21.0",
|
||||||
@@ -6520,25 +6519,6 @@
|
|||||||
"acorn": "^8.14.0"
|
"acorn": "^8.14.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/agentation": {
|
|
||||||
"version": "3.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/agentation/-/agentation-3.0.2.tgz",
|
|
||||||
"integrity": "sha512-iGzBxFVTuZEIKzLY6AExSLAQH6i6SwxV4pAu7v7m3X6bInZ7qlZXAwrEqyc4+EfP4gM7z2RXBF6SF4DeH0f2lA==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "PolyForm-Shield-1.0.0",
|
|
||||||
"peerDependencies": {
|
|
||||||
"react": ">=18.0.0",
|
|
||||||
"react-dom": ">=18.0.0"
|
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"react": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"react-dom": {
|
|
||||||
"optional": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/ai": {
|
"node_modules/ai": {
|
||||||
"version": "6.0.141",
|
"version": "6.0.141",
|
||||||
"resolved": "https://registry.npmjs.org/ai/-/ai-6.0.141.tgz",
|
"resolved": "https://registry.npmjs.org/ai/-/ai-6.0.141.tgz",
|
||||||
|
|||||||
@@ -81,7 +81,6 @@
|
|||||||
"@types/react": "^19",
|
"@types/react": "^19",
|
||||||
"@types/react-dom": "^19",
|
"@types/react-dom": "^19",
|
||||||
"@vitest/coverage-v8": "^4.0.18",
|
"@vitest/coverage-v8": "^4.0.18",
|
||||||
"agentation": "^3.0.2",
|
|
||||||
"prisma": "^5.22.0",
|
"prisma": "^5.22.0",
|
||||||
"tailwindcss": "^4.0.0",
|
"tailwindcss": "^4.0.0",
|
||||||
"tsx": "^4.21.0",
|
"tsx": "^4.21.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user