feat: filter issues by estimate points (#978)

This commit is contained in:
pablohashescobar 2023-05-02 00:50:10 +05:30 committed by GitHub
parent 982566b5b4
commit 887cac5612
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,6 +13,17 @@ def filter_state(params, filter, method):
return filter return filter
def filter_estimate_point(params, filter, method):
if method == "GET":
estimate_points = params.get("estimate_point").split(",")
if len(estimate_points) and "" not in estimate_points:
filter["estimate_point__in"] = estimate_points
else:
if params.get("estimate_point", None) and len(params.get("estimate_point")):
filter["estimate_point__in"] = params.get("estimate_point")
return filter
def filter_priority(params, filter, method): def filter_priority(params, filter, method):
if method == "GET": if method == "GET":
priorties = params.get("priority").split(",") priorties = params.get("priority").split(",")
@ -192,6 +203,7 @@ def issue_filters(query_params, method):
ISSUE_FILTER = { ISSUE_FILTER = {
"state": filter_state, "state": filter_state,
"estimate_point": filter_estimate_point,
"priority": filter_priority, "priority": filter_priority,
"parent": filter_parent, "parent": filter_parent,
"labels": filter_labels, "labels": filter_labels,