mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-18 11:56:01 +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:
@@ -3527,10 +3527,23 @@ export const api = {
|
||||
request<UnlinkedSpool[]>('/spoolman/spools/unlinked'),
|
||||
getLinkedSpools: () =>
|
||||
request<LinkedSpoolsMap>('/spoolman/spools/linked'),
|
||||
linkSpool: (spoolId: number, spoolTag: string) =>
|
||||
linkSpool: (
|
||||
spoolId: number,
|
||||
context: {
|
||||
spoolTag: string;
|
||||
printerId: number;
|
||||
amsId: number;
|
||||
trayId: number;
|
||||
}
|
||||
) =>
|
||||
request<{ success: boolean; message: string }>(`/spoolman/spools/${spoolId}/link`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ spool_tag: spoolTag }),
|
||||
body: JSON.stringify({
|
||||
spool_tag: context.spoolTag,
|
||||
printer_id: context.printerId,
|
||||
ams_id: context.amsId,
|
||||
tray_id: context.trayId,
|
||||
}),
|
||||
}),
|
||||
unlinkSpool: (spoolId: number) =>
|
||||
request<{ success: boolean; message: string }>(`/spoolman/spools/${spoolId}/unlink`, {
|
||||
|
||||
Reference in New Issue
Block a user