Skip to content

Commit

Permalink
fixes in asset api
Browse files Browse the repository at this point in the history
  • Loading branch information
siewer committed Jun 7, 2024
1 parent 34bc872 commit 7d386ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public List<ProjectAssetModel> getAssetsForProject(Project project) {
long low = waVulns.stream()
.filter(cv -> cv.getSeverity().equals(Constants.VULN_CRITICALITY_LOW))
.count();
projectAssetModels.add(new ProjectAssetModel().convertWebApp(wa, (int) crit, (int) medium, (int) low, false));
projectAssetModels.add(new ProjectAssetModel().convertWebApp(wa, (int) crit, (int) medium, (int) low, (crit + medium + low) > 0));
});

findInterfaceService.findByAssetIn(new ArrayList<>(project.getAssets())).forEach(intf -> {
Expand All @@ -188,7 +188,7 @@ public List<ProjectAssetModel> getAssetsForProject(Project project) {
long low = iVulns.stream()
.filter(cv -> cv.getSeverity().equals(Constants.VULN_CRITICALITY_LOW))
.count();
projectAssetModels.add(new ProjectAssetModel().convertInterface(intf, (int) crit, (int) medium, (int) low, false));
projectAssetModels.add(new ProjectAssetModel().convertInterface(intf, (int) crit, (int) medium, (int) low, (crit + medium + low) > 0));
});
return projectAssetModels;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/mixeway/db/entity/CodeProject.java
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ public void setVulns(Set<ProjectVulnerability> vulns) {
this.vulns = vulns;
}

@ManyToOne(fetch = FetchType.LAZY, optional = true)
@ManyToOne(fetch = FetchType.EAGER, optional = true)
@JoinColumn(name = "parent_id", nullable = true)
@OnDelete(action = OnDeleteAction.CASCADE)
public CodeProject getParent() {
Expand Down

0 comments on commit 7d386ec

Please sign in to comment.