1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-07-02 16:38:37 +00:00

Add optional sort option in category page

closes #1552
This commit is contained in:
Romain de Laage 2022-10-16 07:36:59 +02:00 committed by Frédéric Guillot
parent ec47106c26
commit 83e1f154b5
26 changed files with 131 additions and 13 deletions

View file

@ -33,6 +33,7 @@ type User struct {
DefaultReadingSpeed int `json:"default_reading_speed"`
CJKReadingSpeed int `json:"cjk_reading_speed"`
DefaultHomePage string `json:"default_home_page"`
CategoriesSortOrder string `json:"categories_sort_order"`
}
// UserCreationRequest represents the request to create a user.
@ -65,6 +66,7 @@ type UserModificationRequest struct {
DefaultReadingSpeed *int `json:"default_reading_speed"`
CJKReadingSpeed *int `json:"cjk_reading_speed"`
DefaultHomePage *string `json:"default_home_page"`
CategoriesSortOrder *string `json:"categories_sort_order"`
}
// Patch updates the User object with the modification request.
@ -144,6 +146,10 @@ func (u *UserModificationRequest) Patch(user *User) {
if u.DefaultHomePage != nil {
user.DefaultHomePage = *u.DefaultHomePage
}
if u.CategoriesSortOrder != nil {
user.CategoriesSortOrder = *u.CategoriesSortOrder
}
}
// UseTimezone converts last login date to the given timezone.