diff --git a/services_backend/routes/button.py b/services_backend/routes/button.py index f8dd4b1..3468b28 100644 --- a/services_backend/routes/button.py +++ b/services_backend/routes/button.py @@ -129,9 +129,9 @@ def get_buttons( "id": button.id, "icon": button.icon, "name": button.name, - "link": button.link, "order": button.order, "type": button.type, + "link": button.link if view == ButtonView.ACTIVE else None, "view": view.value, "required_scopes": button.required_scopes, "optional_scopes": button.optional_scopes, @@ -139,6 +139,7 @@ def get_buttons( if view == ButtonView.ACTIVE: to_add["scopes"] = list(scopes) result["buttons"].append(to_add) + return result @@ -177,9 +178,9 @@ def get_button( "id": button.id, "icon": button.icon, "name": button.name, - "link": button.link, "order": button.order, "type": button.type, + "link": button.link if view == ButtonView.ACTIVE else None, "view": view.value, "required_scopes": button.required_scopes, "optional_scopes": button.optional_scopes, @@ -305,7 +306,7 @@ def get_service( "id": button.id, "icon": button.icon, "name": button.name, - "link": button.link, + "link": button.link if view == ButtonView.ACTIVE else None, "order": button.order, "type": button.type, "view": view.value, diff --git a/services_backend/routes/category.py b/services_backend/routes/category.py index c924938..fb1cc84 100644 --- a/services_backend/routes/category.py +++ b/services_backend/routes/category.py @@ -119,7 +119,7 @@ def get_categories( "id": button.id, "icon": button.icon, "name": button.name, - "link": button.link, + "link": (button.link if view == ButtonView.ACTIVE else None), "order": button.order, "type": button.type, "view": view.value,