Skip to content

Commit 8ca34d5

Browse files
fix(admin): allow editing inactive resources in admin UI (#1567)
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> Co-authored-by: Mihai Criveti <crivetimihai@gmail.com>
1 parent 8ca27b7 commit 8ca34d5

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)