mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-19 07:33:18 +02:00
[Fix]: Update location when linking/unlinking to/from Spoolman (#669)
* Enhance link spool functionality with additional printer and AMS details * Refactor linkSpool function to accept detailed context object for improved spooling integration * Enhance LinkSpoolModal to include amsName in props and linkSpool mutation for improved functionality * Add amsName prop to PrinterCard for enhanced spool linking functionality * Updates LinkSpoolModal test to work with recent spool location update changes * Adds clear_location to unlink testing * Refactor LinkSpoolRequest to remove ams_name and update location generation logic for improved clarity * Remove amsName from LinkSpoolModal and PrinterCard for cleaner API integration * Remove amsName from LinkSpoolModal test props and update linkSpool mock response for improved clarity
This commit is contained in:
@@ -46,7 +46,12 @@ export function LinkSpoolModal({ isOpen, onClose, tagUid, trayUuid, printerId, a
|
||||
|
||||
const linkMutation = useMutation({
|
||||
mutationFn: (spoolId: number) =>
|
||||
api.linkSpool(spoolId, spoolTag!),
|
||||
api.linkSpool(spoolId, {
|
||||
spoolTag: spoolTag!,
|
||||
printerId,
|
||||
amsId,
|
||||
trayId,
|
||||
}),
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ['unlinked-spools'] });
|
||||
queryClient.invalidateQueries({ queryKey: ['linked-spools'] });
|
||||
|
||||
Reference in New Issue
Block a user