Merge branch 'rrt/dev' into rrt/testing

This commit is contained in:
Aaron Louie 2020-06-07 22:39:34 -04:00
commit 1c8c085afe
2 changed files with 28 additions and 0 deletions

View File

@ -828,6 +828,28 @@ paths:
type: array type: array
items: items:
$ref: "#/components/schemas/ApprovalCounts" $ref: "#/components/schemas/ApprovalCounts"
/all_approvals:
parameters:
- name: status
in: query
required: false
description: If set to true, returns all the approvals with any status. Defaults to false, leaving out canceled approvals.
schema:
type: boolean
get:
operationId: crc.api.approval.get_all_approvals
summary: Provides a list of all workflows approvals
tags:
- Approvals
responses:
'200':
description: An array of approvals
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Approval"
/approval: /approval:
parameters: parameters:
- name: status - name: status

View File

@ -63,6 +63,12 @@ def get_approval_counts(as_user=None):
return counts return counts
def get_all_approvals(status=None):
approvals = ApprovalService.get_all_approvals(include_cancelled=status is True)
results = ApprovalSchema(many=True).dump(approvals)
return results
def get_approvals(status=None, as_user=None): def get_approvals(status=None, as_user=None):
#status = ApprovalStatus.PENDING.value #status = ApprovalStatus.PENDING.value
user = g.user.uid user = g.user.uid