mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-28 10:26:33 +02:00
feat: add page URL to Confluence page creation and update responses instead of showing page id
This commit is contained in:
parent
a9683bb1dc
commit
2c17c355d5
4 changed files with 44 additions and 9 deletions
|
|
@ -187,6 +187,10 @@ def create_create_confluence_page_tool(
|
|||
raise
|
||||
|
||||
page_id = str(api_result.get("id", ""))
|
||||
page_links = api_result.get("_links", {}) if isinstance(api_result, dict) else {}
|
||||
page_url = ""
|
||||
if page_links.get("base") and page_links.get("webui"):
|
||||
page_url = f"{page_links['base']}{page_links['webui']}"
|
||||
|
||||
kb_message_suffix = ""
|
||||
try:
|
||||
|
|
@ -213,6 +217,7 @@ def create_create_confluence_page_tool(
|
|||
return {
|
||||
"status": "success",
|
||||
"page_id": page_id,
|
||||
"page_url": page_url,
|
||||
"message": f"Confluence page '{final_title}' created successfully.{kb_message_suffix}",
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ def create_update_confluence_page_tool(
|
|||
client = ConfluenceHistoryConnector(
|
||||
session=db_session, connector_id=final_connector_id
|
||||
)
|
||||
await client.update_page(
|
||||
api_result = await client.update_page(
|
||||
page_id=final_page_id,
|
||||
title=final_title,
|
||||
body=final_content,
|
||||
|
|
@ -190,6 +190,11 @@ def create_update_confluence_page_tool(
|
|||
}
|
||||
raise
|
||||
|
||||
page_links = api_result.get("_links", {}) if isinstance(api_result, dict) else {}
|
||||
page_url = ""
|
||||
if page_links.get("base") and page_links.get("webui"):
|
||||
page_url = f"{page_links['base']}{page_links['webui']}"
|
||||
|
||||
kb_message_suffix = ""
|
||||
if final_document_id:
|
||||
try:
|
||||
|
|
@ -219,6 +224,7 @@ def create_update_confluence_page_tool(
|
|||
return {
|
||||
"status": "success",
|
||||
"page_id": final_page_id,
|
||||
"page_url": page_url,
|
||||
"message": f"Confluence page '{final_title}' updated successfully.{kb_message_suffix}",
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue