[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:
Dakota G
2026-03-11 09:38:14 +01:00
committed by GitHub
parent 253828c2b5
commit be2ddbee5d
5 changed files with 49 additions and 8 deletions
+6 -1
View File
@@ -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'] });