Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
fix: Correct component search relation
Browse files Browse the repository at this point in the history
  • Loading branch information
devkcud committed Oct 29, 2024
1 parent c641763 commit d32a466
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/service/repository/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,13 +499,13 @@ func (cr *componentRepository) Search(issuerID uint, search *dto.SearchComponent
}

if search.OrderAlphabetic {
query = query.Order("p.name " + orderDirection)
query = query.Order("c.name " + orderDirection)
} else if search.OrderCreationDate {
query = query.Order("p.created_at " + orderDirection)
query = query.Order("c.created_at " + orderDirection)
} else if search.OrderModifiedDate {
query = query.Order("p.updated_at " + orderDirection)
query = query.Order("c.updated_at " + orderDirection)
} else {
query = query.Order("p.created_at " + orderDirection)
query = query.Order("c.created_at " + orderDirection)
}

if search.MostHolders {
Expand Down

0 comments on commit d32a466

Please sign in to comment.