1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-05-19 13:28:20 +02:00

Upgrade banner

This commit is contained in:
binwiederhier 2023-01-04 22:47:12 -05:00
parent a91da7cf2c
commit 3280c2c440
22 changed files with 114 additions and 118 deletions

View file

@ -80,18 +80,18 @@ func (s *Server) handleAccountGet(w http.ResponseWriter, _ *http.Request, v *vis
}
if v.user.Plan != nil {
response.Plan = &apiAccountPlan{
Code: v.user.Plan.Code,
Upgradable: v.user.Plan.Upgradable,
Code: v.user.Plan.Code,
Upgradeable: v.user.Plan.Upgradeable,
}
} else if v.user.Role == user.RoleAdmin {
response.Plan = &apiAccountPlan{
Code: string(user.PlanUnlimited),
Upgradable: false,
Code: string(user.PlanUnlimited),
Upgradeable: false,
}
} else {
response.Plan = &apiAccountPlan{
Code: string(user.PlanDefault),
Upgradable: true,
Code: string(user.PlanDefault),
Upgradeable: true,
}
}
reservations, err := s.userManager.Reservations(v.user.Name)
@ -111,8 +111,8 @@ func (s *Server) handleAccountGet(w http.ResponseWriter, _ *http.Request, v *vis
response.Username = user.Everyone
response.Role = string(user.RoleAnonymous)
response.Plan = &apiAccountPlan{
Code: string(user.PlanNone),
Upgradable: true,
Code: string(user.PlanNone),
Upgradeable: true,
}
}
w.Header().Set("Content-Type", "application/json")