updated group api so it is not under tasks

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

View File

@ -1115,11 +1115,11 @@ paths:
items: items:
$ref: "#/components/schemas/Task" $ref: "#/components/schemas/Task"
/tasks/user-groups: /user-groups/for-current-user:
get: get:
tags: tags:
- Process Instances - 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 summary: Group identifiers for current logged in user
responses: responses:
"200": "200":

View File

@ -81,6 +81,11 @@ permissions:
users: [] users: []
allowed_permissions: [read] allowed_permissions: [read]
uri: /v1.0/service-tasks 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 # read all for everybody

View File

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

View File

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