mirror of
https://github.com/zitadel/zitadel
synced 2024-11-22 00:39:36 +00:00
fix: default message text query (#3064)
This commit is contained in:
parent
3902f9adb5
commit
eaaf76a6eb
@ -168,13 +168,8 @@ func (q *Queries) CustomMessageTextByTypeAndLanguage(ctx context.Context, aggreg
|
||||
sq.Eq{
|
||||
MessageTextColType.identifier(): messageType,
|
||||
},
|
||||
sq.Or{
|
||||
sq.Eq{
|
||||
MessageTextColAggregateID.identifier(): aggregateID,
|
||||
},
|
||||
sq.Eq{
|
||||
MessageTextColAggregateID.identifier(): domain.IAMID,
|
||||
},
|
||||
sq.Eq{
|
||||
MessageTextColAggregateID.identifier(): aggregateID,
|
||||
},
|
||||
},
|
||||
).
|
||||
@ -185,7 +180,11 @@ func (q *Queries) CustomMessageTextByTypeAndLanguage(ctx context.Context, aggreg
|
||||
}
|
||||
|
||||
row := q.client.QueryRowContext(ctx, query, args...)
|
||||
return scan(row)
|
||||
msg, err := scan(row)
|
||||
if errors.IsNotFound(err) {
|
||||
return q.IAMMessageTextByTypeAndLanguage(ctx, messageType, language)
|
||||
}
|
||||
return msg, err
|
||||
}
|
||||
|
||||
func (q *Queries) IAMMessageTextByTypeAndLanguage(ctx context.Context, messageType, language string) (*MessageText, error) {
|
||||
@ -219,6 +218,7 @@ func (q *Queries) IAMMessageTextByTypeAndLanguage(ctx context.Context, messageTy
|
||||
}
|
||||
result := notificationText.GetMessageTextByType(messageType)
|
||||
result.IsDefault = true
|
||||
result.AggregateID = domain.IAMID
|
||||
return result, nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user