mirror of
https://github.com/miniflux/v2.git
synced 2025-08-01 17:38:37 +00:00
parent
ec47106c26
commit
83e1f154b5
26 changed files with 131 additions and 13 deletions
13
model/categories_sort_options.go
Normal file
13
model/categories_sort_options.go
Normal file
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2017 Frédéric Guillot. All rights reserved.
|
||||
// Use of this source code is governed by the Apache 2.0
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package model // import "miniflux.app/model"
|
||||
|
||||
// HomePages returns the list of available home pages.
|
||||
func CategoriesSortOptions() map[string]string {
|
||||
return map[string]string{
|
||||
"unread_count": "form.prefs.select.unread_count",
|
||||
"alphabetical": "form.prefs.select.alphabetical",
|
||||
}
|
||||
}
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue