Skip to content

Commit

Permalink
fix: Wrong package count when asset index
Browse files Browse the repository at this point in the history
  • Loading branch information
zekiahmetbayar committed Jan 8, 2024
1 parent 1247a15 commit 2482d74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/assets/assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func Index(c *fiber.Ctx) error {
// Set query
sub_query := database.Connection().
Model(&entities.Asset{}).
Select("assets.*", "count(*) as package_count").
Select("assets.*", "count(packages.name) as package_count").
Joins("left join asset_packages ap on ap.asset_id = assets.id").
Joins("left join packages on ap.package_id = packages.id").
Group("assets.id").Order("package_count desc")
Expand Down

0 comments on commit 2482d74

Please sign in to comment.