mirror of
https://github.com/miniflux/v2.git
synced 2025-08-11 17:51:01 +00:00
Make default home page configurable
This commit is contained in:
parent
45a9fd5af6
commit
03a1cfcd5e
30 changed files with 125 additions and 14 deletions
|
@ -91,6 +91,12 @@ func ValidateUserModification(store *storage.Storage, userID int64, changes *mod
|
|||
}
|
||||
}
|
||||
|
||||
if changes.DefaultHomePage != nil {
|
||||
if err := validateDefaultHomePage(*changes.DefaultHomePage); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -156,3 +162,11 @@ func validateDisplayMode(displayMode string) *ValidationError {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func validateDefaultHomePage(defaultHomePage string) *ValidationError {
|
||||
defaultHomePages := model.HomePages()
|
||||
if _, found := defaultHomePages[defaultHomePage]; !found {
|
||||
return NewValidationError("error.invalid_default_home_page")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue