From 4a89652ad859cb5a789003738a442a28aa6ef943 Mon Sep 17 00:00:00 2001 From: padreug Date: Wed, 7 Jan 2026 00:46:32 +0100 Subject: [PATCH] Fix stall update API to use PUT with full object MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Changed updateStall from PATCH to PUT (LNbits API requirement) - Updated to send full stall object instead of partial update - Merges form values with existing stall data before sending 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/modules/market/components/MarketSettings.vue | 10 +++++++--- src/modules/market/services/nostrmarketAPI.ts | 14 ++++---------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/modules/market/components/MarketSettings.vue b/src/modules/market/components/MarketSettings.vue index f636dcc..0c2fccd 100644 --- a/src/modules/market/components/MarketSettings.vue +++ b/src/modules/market/components/MarketSettings.vue @@ -389,14 +389,18 @@ const onSubmit = form.handleSubmit(async (values) => { throw new Error('No wallet admin key available') } - // Update the stall with new values - const updatedStall = await nostrmarketAPI.updateStall(adminKey, currentStall.value.id, { + // Build full stall object with updated values (API requires PUT with full object) + const stallToUpdate = { + ...currentStall.value, name: values.name, config: { + ...currentStall.value.config, description: values.description || '', image_url: values.imageUrl || undefined } - }) + } + + const updatedStall = await nostrmarketAPI.updateStall(adminKey, stallToUpdate) currentStall.value = updatedStall toast.success('Store settings saved successfully!') diff --git a/src/modules/market/services/nostrmarketAPI.ts b/src/modules/market/services/nostrmarketAPI.ts index 528336f..170cee7 100644 --- a/src/modules/market/services/nostrmarketAPI.ts +++ b/src/modules/market/services/nostrmarketAPI.ts @@ -331,23 +331,17 @@ export class NostrmarketAPI extends BaseService { /** * Update an existing stall + * Note: The LNbits API uses PUT and expects the full stall object */ async updateStall( walletAdminkey: string, - stallId: string, - stallData: Partial<{ - name: string - config: { - description?: string - image_url?: string - } - }> + stallData: Stall ): Promise { const stall = await this.request( - `/api/v1/stall/${stallId}`, + `/api/v1/stall/${stallData.id}`, walletAdminkey, { - method: 'PATCH', + method: 'PUT', body: JSON.stringify(stallData), } )