Skip to content

Commit 4c6467e

Browse files
committed
fix(admin): allow editing inactive resources in admin UI
Include inactive resources when fetching resource details for editing. This fixes the 404 error that occurred when clicking Edit on an inactive resource in the admin UI. Closes #1545 Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
1 parent 8ca27b7 commit 4c6467e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mcpgateway/admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8382,7 +8382,7 @@ async def admin_get_resource(resource_id: str, db: Session = Depends(get_db), us
83828382
"""
83838383
LOGGER.debug(f"User {get_user_email(user)} requested details for resource ID {resource_id}")
83848384
try:
8385-
resource = await resource_service.get_resource_by_id(db, resource_id)
8385+
resource = await resource_service.get_resource_by_id(db, resource_id, include_inactive=True)
83868386
# content = await resource_service.read_resource(db, resource_id=resource_id)
83878387
return {"resource": resource.model_dump(by_alias=True)} # , "content": None}
83888388
except ResourceNotFoundError as e:

0 commit comments

Comments
 (0)