Merge branch 'rrt/staging' into rrt/production
This commit is contained in:
commit
2ffdd70f06
22
crc/api.yml
22
crc/api.yml
|
@ -828,6 +828,28 @@ paths:
|
|||
type: array
|
||||
items:
|
||||
$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:
|
||||
parameters:
|
||||
- name: status
|
||||
|
|
|
@ -63,6 +63,12 @@ def get_approval_counts(as_user=None):
|
|||
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):
|
||||
#status = ApprovalStatus.PENDING.value
|
||||
user = g.user.uid
|
||||
|
|
Loading…
Reference in New Issue