mirror of
https://github.com/idanoo/autobrr
synced 2025-07-22 16:29:12 +00:00
feat(filters): sort by created and updated (#1751)
* feat(web): sort by date * feat(filters): sort by created_at and updated_at --------- Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com>
This commit is contained in:
parent
5e6c4b16c5
commit
009647fcd1
2 changed files with 6 additions and 2 deletions
|
@ -71,7 +71,7 @@ func (h filterHandler) getFilters(w http.ResponseWriter, r *http.Request) {
|
|||
order := ""
|
||||
|
||||
s := strings.Split(sort, "-")
|
||||
if s[0] == "name" || s[0] == "priority" {
|
||||
if s[0] == "name" || s[0] == "priority" || s[0] == "created_at" || s[0] == "updated_at" {
|
||||
field = s[0]
|
||||
}
|
||||
|
||||
|
|
|
@ -825,7 +825,11 @@ export const SortSelectFilter = ({ dispatch }: any) => {
|
|||
{ label: "Name A-Z", value: "name-asc" },
|
||||
{ label: "Name Z-A", value: "name-desc" },
|
||||
{ label: "Priority highest", value: "priority-desc" },
|
||||
{ label: "Priority lowest", value: "priority-asc" }
|
||||
{ label: "Priority lowest", value: "priority-asc" },
|
||||
{ label: "Recently created first", value: "created_at-desc" },
|
||||
{ label: "Recently created last", value: "created_at-asc" },
|
||||
{ label: "Recently updated first", value: "updated_at-desc" },
|
||||
{ label: "Recently updated last", value: "updated_at-asc" }
|
||||
];
|
||||
|
||||
// Render a multi-select box
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue