mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-18 21:47:39 +02:00
Feature/multiple switches per prtinter (#786)
Feature/multiple switches per prtinter (#786)
This commit is contained in:
@@ -255,7 +255,7 @@ export function AddSmartPlugModal({ plug, onClose }: AddSmartPlugModalProps) {
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ['smart-plugs'] });
|
||||
// Also invalidate printer card HA entity queries
|
||||
queryClient.invalidateQueries({ queryKey: ['scriptPlugsByPrinter'] });
|
||||
queryClient.invalidateQueries({ queryKey: ['smartPlugsByPrinter'] });
|
||||
onClose();
|
||||
},
|
||||
onError: (err: Error) => {
|
||||
@@ -269,7 +269,7 @@ export function AddSmartPlugModal({ plug, onClose }: AddSmartPlugModalProps) {
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ['smart-plugs'] });
|
||||
// Also invalidate printer card HA entity queries
|
||||
queryClient.invalidateQueries({ queryKey: ['scriptPlugsByPrinter'] });
|
||||
queryClient.invalidateQueries({ queryKey: ['smartPlugsByPrinter'] });
|
||||
onClose();
|
||||
},
|
||||
onError: (err: Error) => {
|
||||
|
||||
@@ -80,8 +80,7 @@ export function SmartPlugCard({ plug, onEdit }: SmartPlugCardProps) {
|
||||
queryClient.invalidateQueries({ queryKey: ['smart-plugs'] });
|
||||
// Also invalidate printer-specific smart plug queries to keep PrintersPage in sync
|
||||
if (plug.printer_id) {
|
||||
queryClient.invalidateQueries({ queryKey: ['smartPlugByPrinter', plug.printer_id] });
|
||||
queryClient.invalidateQueries({ queryKey: ['scriptPlugsByPrinter', plug.printer_id] });
|
||||
queryClient.invalidateQueries({ queryKey: ['smartPlugsByPrinter', plug.printer_id] });
|
||||
}
|
||||
},
|
||||
});
|
||||
@@ -93,7 +92,7 @@ export function SmartPlugCard({ plug, onEdit }: SmartPlugCardProps) {
|
||||
queryClient.invalidateQueries({ queryKey: ['smart-plugs'] });
|
||||
// Also invalidate printer card HA entity queries
|
||||
if (plug.printer_id) {
|
||||
queryClient.invalidateQueries({ queryKey: ['scriptPlugsByPrinter', plug.printer_id] });
|
||||
queryClient.invalidateQueries({ queryKey: ['smartPlugsByPrinter', plug.printer_id] });
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user