mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 02:54:20 +00:00
fix: default message text query (#3064)
This commit is contained in:
parent
3902f9adb5
commit
eaaf76a6eb
@ -168,14 +168,9 @@ 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,
|
||||
},
|
||||
},
|
||||
},
|
||||
).
|
||||
OrderBy(MessageTextColAggregateID.identifier()).
|
||||
@ -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