shared catalog in Bestellungen, catalog picker in line items, Ersatzbeschaffung flag, vendor detail flash fix
This commit is contained in:
@@ -48,7 +48,7 @@ export default function LieferantDetail() {
|
||||
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
|
||||
|
||||
// ── Query ──
|
||||
const { data: vendor, isLoading, isError } = useQuery({
|
||||
const { data: vendor, isPending, isLoading, isError } = useQuery({
|
||||
queryKey: ['lieferant', vendorId],
|
||||
queryFn: () => bestellungApi.getVendor(vendorId),
|
||||
enabled: !isNew && !!vendorId,
|
||||
@@ -128,7 +128,7 @@ export default function LieferantDetail() {
|
||||
}
|
||||
|
||||
// ── Loading / Error ──
|
||||
if (!isNew && isLoading) {
|
||||
if (!isNew && isPending) {
|
||||
return (
|
||||
<DashboardLayout>
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 2, mb: 3 }}>
|
||||
@@ -144,7 +144,7 @@ export default function LieferantDetail() {
|
||||
);
|
||||
}
|
||||
|
||||
if (!isNew && (isError || !vendor)) {
|
||||
if (!isNew && !isPending && (isError || !vendor)) {
|
||||
return (
|
||||
<DashboardLayout>
|
||||
<Box sx={{ p: 4, textAlign: 'center' }}>
|
||||
|
||||
Reference in New Issue
Block a user