feat: show reset credits publicly
This commit is contained in:
@@ -230,7 +230,6 @@ func (a *App) dashboardAPI(w http.ResponseWriter, r *http.Request) {
|
||||
func publicDashboard(d Dashboard) Dashboard {
|
||||
d.Account.Email = nil
|
||||
d.Account.AuthMode = nil
|
||||
d.ResetCredits = nil
|
||||
d.LastError = ""
|
||||
return d
|
||||
}
|
||||
|
||||
@@ -134,8 +134,8 @@ func TestAnonymousOverviewIsReadOnly(t *testing.T) {
|
||||
if publicDashboardBody.Account.Email != nil || publicDashboardBody.Account.AuthMode != nil {
|
||||
t.Fatalf("anonymous dashboard account = %#v; identity fields were not redacted", publicDashboardBody.Account)
|
||||
}
|
||||
if publicDashboardBody.ResetCredits != nil {
|
||||
t.Fatalf("anonymous dashboard reset credits = %#v; entitlement data was not redacted", publicDashboardBody.ResetCredits)
|
||||
if publicDashboardBody.ResetCredits == nil || publicDashboardBody.ResetCredits.AvailableCount != 2 {
|
||||
t.Fatalf("anonymous dashboard reset credits = %#v; want two credits", publicDashboardBody.ResetCredits)
|
||||
}
|
||||
|
||||
for _, path := range []string{"/api/v1/settings/general", "/api/v1/accounts", "/api/v1/accounts/1/sync"} {
|
||||
|
||||
Reference in New Issue
Block a user