Remove awkward subscription id
This commit is contained in:
parent
9131d3d521
commit
cc309e87e9
12 changed files with 67 additions and 104 deletions
|
@ -726,7 +726,6 @@ func TestManager_ChangeSettings(t *testing.T) {
|
|||
},
|
||||
Subscriptions: []*Subscription{
|
||||
{
|
||||
ID: "someID",
|
||||
BaseURL: "https://ntfy.sh",
|
||||
Topic: "mytopic",
|
||||
DisplayName: util.String("My Topic"),
|
||||
|
@ -742,7 +741,6 @@ func TestManager_ChangeSettings(t *testing.T) {
|
|||
require.Equal(t, util.String("ding"), u.Prefs.Notification.Sound)
|
||||
require.Equal(t, util.Int(2), u.Prefs.Notification.MinPriority)
|
||||
require.Nil(t, u.Prefs.Notification.DeleteAfter)
|
||||
require.Equal(t, "someID", u.Prefs.Subscriptions[0].ID)
|
||||
require.Equal(t, "https://ntfy.sh", u.Prefs.Subscriptions[0].BaseURL)
|
||||
require.Equal(t, "mytopic", u.Prefs.Subscriptions[0].Topic)
|
||||
require.Equal(t, util.String("My Topic"), u.Prefs.Subscriptions[0].DisplayName)
|
||||
|
|
|
@ -105,12 +105,19 @@ func (t *Tier) Context() log.Context {
|
|||
|
||||
// Subscription represents a user's topic subscription
|
||||
type Subscription struct {
|
||||
ID string `json:"id"`
|
||||
BaseURL string `json:"base_url"`
|
||||
Topic string `json:"topic"`
|
||||
DisplayName *string `json:"display_name"`
|
||||
}
|
||||
|
||||
// Context returns fields for the log
|
||||
func (s *Subscription) Context() log.Context {
|
||||
return log.Context{
|
||||
"base_url": s.BaseURL,
|
||||
"topic": s.Topic,
|
||||
}
|
||||
}
|
||||
|
||||
// NotificationPrefs represents the user's notification settings
|
||||
type NotificationPrefs struct {
|
||||
Sound *string `json:"sound,omitempty"`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue