add State in MessageOut struct

This commit is contained in:
Florian du Garage Num 2025-09-19 16:00:45 +02:00
parent 18543f7dbb
commit 30186a5653
2 changed files with 2 additions and 1 deletions

View File

@ -42,7 +42,7 @@ func messageToDomain(input Message) (MessageOut, error) {
},
CreatedAt: input.CreatedAt,
}
if len(input.States) > 0 || input.Device != nil {
if len(input.States) > 0 || input.DeviceID != nil {
state := modelToMessageState(input)
out.State = &state
}

View File

@ -26,6 +26,7 @@ type MessageOut struct {
MessageIn
CreatedAt time.Time
State *MessageStateOut `json:"state,omitempty"`
}
type MessageStateIn struct {