1
0
Fork 0
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:
Romain de Laage 2022-07-20 22:07:55 +02:00 committed by Frédéric Guillot
parent 45a9fd5af6
commit 03a1cfcd5e
30 changed files with 125 additions and 14 deletions

View file

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