updated group api so it is not under tasks

This commit is contained in:
jasquat 2022-12-12 13:19:27 -05:00
parent 978849d379
commit ec754cbee7
4 changed files with 10 additions and 5 deletions

View File

@ -1115,11 +1115,11 @@ paths:
items:
$ref: "#/components/schemas/Task"
/tasks/user-groups:
/user-groups/for-current-user:
get:
tags:
- Process Instances
operationId: spiffworkflow_backend.routes.process_api_blueprint.task_list_user_groups
operationId: spiffworkflow_backend.routes.process_api_blueprint.user_groups_for_current_user
summary: Group identifiers for current logged in user
responses:
"200":

View File

@ -81,6 +81,11 @@ permissions:
users: []
allowed_permissions: [read]
uri: /v1.0/service-tasks
user-groups-for-current-user:
groups: [everybody]
users: []
allowed_permissions: [read]
uri: /v1.0/user-groups/for-current-user
# read all for everybody

View File

@ -1322,8 +1322,8 @@ def task_list_for_my_groups(
)
def task_list_user_groups() -> flask.wrappers.Response:
"""Task_list_user_groups."""
def user_groups_for_current_user() -> flask.wrappers.Response:
"""User_groups_for_current_user."""
groups = g.user.groups
# TODO: filter out the default group and have a way to know what is the default group
group_identifiers = [i.identifier for i in groups if i.identifier != "everybody"]

View File

@ -7,7 +7,7 @@ export default function TasksWaitingForMyGroups() {
useEffect(() => {
HttpService.makeCallToBackend({
path: `/tasks/user-groups`,
path: `/user-groups/for-current-user`,
successCallback: setUserGroups,
});
}, [setUserGroups]);