Skip to content

Commit 8b2a917

Browse files
waleedlatif1claude
andcommitted
fix(confluence): fetch current space name when updating only description
The Confluence v2 PUT /spaces/{id} endpoint requires the name field. When the user only provides a description update, fetch the current space first to preserve the existing name. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 50adfb6 commit 8b2a917

File tree

1 file changed

+20
-1
lines changed
  • apps/sim/app/api/tools/confluence/space

1 file changed

+20
-1
lines changed

apps/sim/app/api/tools/confluence/space/route.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,26 @@ export async function PUT(request: NextRequest) {
205205
}
206206

207207
const updateBody: Record<string, unknown> = {}
208-
if (name) updateBody.name = name
208+
209+
if (name) {
210+
updateBody.name = name
211+
} else {
212+
const currentResponse = await fetch(url, {
213+
headers: {
214+
Accept: 'application/json',
215+
Authorization: `Bearer ${accessToken}`,
216+
},
217+
})
218+
if (!currentResponse.ok) {
219+
return NextResponse.json(
220+
{ error: `Failed to fetch current space: ${currentResponse.status}` },
221+
{ status: currentResponse.status }
222+
)
223+
}
224+
const currentSpace = await currentResponse.json()
225+
updateBody.name = currentSpace.name
226+
}
227+
209228
if (description !== undefined) {
210229
updateBody.description = { value: description, representation: 'plain' }
211230
}

0 commit comments

Comments
 (0)