Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/sim/app/api/tools/confluence/blogposts/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ export async function PUT(request: NextRequest) {
}

// Fetch current blog post to get version number
const currentUrl = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/blogposts/${blogPostId}`
const currentUrl = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/blogposts/${blogPostId}?body-format=storage`
const currentResponse = await fetch(currentUrl, {
headers: {
Accept: 'application/json',
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/app/api/tools/confluence/page/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export async function PUT(request: NextRequest) {
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
}

const currentPageUrl = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/pages/${pageId}`
const currentPageUrl = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/pages/${pageId}?body-format=storage`
const currentPageResponse = await fetch(currentPageUrl, {
headers: {
Accept: 'application/json',
Expand Down
21 changes: 20 additions & 1 deletion apps/sim/app/api/tools/confluence/space/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,26 @@ export async function PUT(request: NextRequest) {
}

const updateBody: Record<string, unknown> = {}
if (name) updateBody.name = name

if (name) {
updateBody.name = name
} else {
const currentResponse = await fetch(url, {
headers: {
Accept: 'application/json',
Authorization: `Bearer ${accessToken}`,
},
})
if (!currentResponse.ok) {
return NextResponse.json(
{ error: `Failed to fetch current space: ${currentResponse.status}` },
{ status: currentResponse.status }
)
}
const currentSpace = await currentResponse.json()
updateBody.name = currentSpace.name
}

if (description !== undefined) {
updateBody.description = { value: description, representation: 'plain' }
}
Expand Down