Skip to content

Commit

Permalink
chore: use sqlxx.NullString
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-jonas committed Dec 27, 2023
1 parent 319eeed commit ca7ccc6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion courier/courier_dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func (c *courier) DispatchMessage(ctx context.Context, msg Message) error {
return err
}

channel, ok := c.courierChannels[msg.Channel]
channel, ok := c.courierChannels[msg.Channel.String()]
if !ok {
return errors.Errorf("message %s has unknown channel %q", msg.ID.String(), msg.Channel)
}
Expand Down
3 changes: 2 additions & 1 deletion courier/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/ory/herodot"
"github.com/ory/kratos/courier/template"
"github.com/ory/x/pagination/keysetpagination"
"github.com/ory/x/sqlxx"
"github.com/ory/x/stringsx"
)

Expand Down Expand Up @@ -189,7 +190,7 @@ type Message struct {
// required: true
TemplateType template.TemplateType `json:"template_type" db:"template_type"`

Channel string `json:"channel" db:"channel"`
Channel sqlxx.NullString `json:"channel" db:"channel"`

TemplateData []byte `json:"-" db:"template_data"`
// required: true
Expand Down

0 comments on commit ca7ccc6

Please sign in to comment.