Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Получение link'а кнопки по запросу в зависимости от доступа #59

Merged
merged 7 commits into from
Jul 12, 2024
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
7 changes: 4 additions & 3 deletions services_backend/routes/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,17 @@ 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,
}
if view == ButtonView.ACTIVE:
to_add["scopes"] = list(scopes)
result["buttons"].append(to_add)

return result


Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion services_backend/routes/category.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading