Return subscription from channel-preview [skip-tests]
All checks were successful
Build Docker and Deploy / Run Unit-Tests (push) Has been skipped
Build Docker and Deploy / Build Docker Container (push) Successful in 46s
Build Docker and Deploy / Deploy to Server (push) Successful in 6s

This commit is contained in:
2025-04-12 23:37:06 +02:00
parent 301240b896
commit c0b8a8a3f4
6 changed files with 217 additions and 6 deletions

View File

@@ -24,6 +24,8 @@ type ChannelPreview struct {
DisplayName string `json:"display_name"`
DescriptionName *string `json:"description_name"`
MessagesSent int `json:"messages_sent"`
Subscription *Subscription `json:"subscription"`
}
func (c Channel) WithSubscription(sub *Subscription) ChannelWithSubscription {
@@ -33,7 +35,7 @@ func (c Channel) WithSubscription(sub *Subscription) ChannelWithSubscription {
}
}
func (c Channel) Preview() ChannelPreview {
func (c Channel) Preview(sub *Subscription) ChannelPreview {
return ChannelPreview{
ChannelID: c.ChannelID,
OwnerUserID: c.OwnerUserID,
@@ -41,5 +43,6 @@ func (c Channel) Preview() ChannelPreview {
DisplayName: c.DisplayName,
DescriptionName: c.DescriptionName,
MessagesSent: c.MessagesSent,
Subscription: sub,
}
}