Skip to content

Using db.SearchOrderBy in internal instead of sortType #25808

@yp05327

Description

@yp05327

Feature Description

As we have a globally db.SearchOrderBy for sorting, in some places we still using xorm.Session.Asc(col_name) and xorm.Session.Desc(col_name) which may make mistakes like #25806 and hard to maintain.

I have made a simple keyword search, and found there are two places is using Asc and Desc directly:

  • models/git/commit_status.go: func sortCommitStatusesSession
  • models/issues/issue_search.go: func applySorts

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions