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:
martylukyy 2024-10-04 15:02:27 +02:00 committed by GitHub
parent 5e6c4b16c5
commit 009647fcd1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View file

@ -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]
}

View file

@ -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