Skip to content

Commit

Permalink
api fix
Browse files Browse the repository at this point in the history
  • Loading branch information
guoshijiang committed Jun 13, 2024
1 parent 44e9033 commit c43d22f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion api/solid/api_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def get_audit_projects(request):
params = json.loads(request.body.decode())
service_type_id = params.get("service_type_id", 0)
status = params.get("status", "all")
service_type = ServiceType.objects.filter(id=service_type_id).first()
if service_type_id not in ["0", 0] and status in ["all", "All", "ALL"]:
audit_project_lists = AuditProject.objects.filter(service_type__id=service_type_id).order_by("id").all()
elif status in ["all", "All", "ALL"]:
Expand All @@ -38,7 +39,11 @@ def get_audit_projects(request):
projects_ret_lists = []
for ap in audit_project_lists:
projects_ret_lists.append(ap.as_dict())
return ok_json(projects_ret_lists)
data = {
"service_type": service_type.as_dict(),
"projects": projects_ret_lists
}
return ok_json(data)


# @check_api_token
Expand Down

0 comments on commit c43d22f

Please sign in to comment.