diff --git a/src/lib/components/party/Party.svelte b/src/lib/components/party/Party.svelte index 1998be11..08482f71 100644 --- a/src/lib/components/party/Party.svelte +++ b/src/lib/components/party/Party.svelte @@ -127,25 +127,37 @@ throw new Error('Invalid swap operation - missing items') } - // Call appropriate grid service method based on type + // Call appropriate swap method based on type if (source.type === 'weapon') { - await gridService.moveWeapon(party.id, source.itemId, target.position, editKey || undefined, { - shortcode: party.shortcode - }) - } else if (source.type === 'character') { - await gridService.moveCharacter( + await gridService.swapWeapons( party.id, source.itemId, - target.position, + target.itemId, + editKey || undefined, + { + shortcode: party.shortcode + } + ) + } else if (source.type === 'character') { + await gridService.swapCharacters( + party.id, + source.itemId, + target.itemId, editKey || undefined, { shortcode: party.shortcode } ) } else if (source.type === 'summon') { - await gridService.moveSummon(party.id, source.itemId, target.position, editKey || undefined, { - shortcode: party.shortcode - }) + await gridService.swapSummons( + party.id, + source.itemId, + target.itemId, + editKey || undefined, + { + shortcode: party.shortcode + } + ) } else { throw new Error(`Unknown item type: ${source.type}`) } @@ -154,8 +166,6 @@ partyService.clearPartyCache(party.shortcode) const updated = await partyService.getByShortcode(party.shortcode) return updated - - throw new Error(`Unknown item type: ${source.type}`) } async function handleMove(source: any, target: any): Promise {