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,13 +168,8 @@ func (q *Queries) CustomMessageTextByTypeAndLanguage(ctx context.Context, aggreg
|
|||||||
sq.Eq{
|
sq.Eq{
|
||||||
MessageTextColType.identifier(): messageType,
|
MessageTextColType.identifier(): messageType,
|
||||||
},
|
},
|
||||||
sq.Or{
|
sq.Eq{
|
||||||
sq.Eq{
|
MessageTextColAggregateID.identifier(): aggregateID,
|
||||||
MessageTextColAggregateID.identifier(): aggregateID,
|
|
||||||
},
|
|
||||||
sq.Eq{
|
|
||||||
MessageTextColAggregateID.identifier(): domain.IAMID,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
).
|
).
|
||||||
@ -185,7 +180,11 @@ func (q *Queries) CustomMessageTextByTypeAndLanguage(ctx context.Context, aggreg
|
|||||||
}
|
}
|
||||||
|
|
||||||
row := q.client.QueryRowContext(ctx, query, args...)
|
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) {
|
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 := notificationText.GetMessageTextByType(messageType)
|
||||||
result.IsDefault = true
|
result.IsDefault = true
|
||||||
|
result.AggregateID = domain.IAMID
|
||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user