fix: resolve customer creation fk violation and implement instant updates in admin dialogs
All checks were successful
Staging Build / build (push) Successful in 2m26s

This commit is contained in:
DanielS
2026-06-23 03:27:46 +02:00
parent 898a5253e5
commit 6b76e82220
5 changed files with 35 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
'use client'
import { useState } from 'react'
import { useRouter } from 'next/navigation'
import { useForm } from 'react-hook-form'
import { zodResolver } from '@hookform/resolvers/zod'
import * as z from 'zod'
@@ -54,6 +55,7 @@ export function CategoryDialog({
category?: Category
}) {
const [open, setOpen] = useState(false)
const router = useRouter()
const form = useForm<CategoryFormValues>({
resolver: zodResolver(categorySchema) as any,
@@ -75,6 +77,7 @@ export function CategoryDialog({
}
setOpen(false)
form.reset()
router.refresh()
} catch (error) {
console.error('Error saving category:', error)
}