mirror of
https://github.com/miniflux/v2.git
synced 2025-08-11 17:51:01 +00:00
Add integration tests for users
This commit is contained in:
parent
142e8b3e0c
commit
ec0f642d5d
11 changed files with 267 additions and 33 deletions
|
@ -4,6 +4,8 @@
|
|||
|
||||
package model
|
||||
|
||||
import "github.com/miniflux/miniflux2/errors"
|
||||
|
||||
// GetThemes returns the list of available themes.
|
||||
func GetThemes() map[string]string {
|
||||
return map[string]string{
|
||||
|
@ -11,3 +13,14 @@ func GetThemes() map[string]string {
|
|||
"black": "Black",
|
||||
}
|
||||
}
|
||||
|
||||
// ValidateTheme validates theme value.
|
||||
func ValidateTheme(theme string) error {
|
||||
for key := range GetThemes() {
|
||||
if key == theme {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
return errors.NewLocalizedError("Invalid theme.")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue