mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 00:17:32 +00:00
fix: return correct empty flow if not found (#3749)
This commit is contained in:
@@ -63,7 +63,7 @@ type Flow struct {
|
||||
}
|
||||
|
||||
func (q *Queries) GetFlow(ctx context.Context, flowType domain.FlowType, orgID string) (*Flow, error) {
|
||||
query, scan := prepareFlowQuery()
|
||||
query, scan := prepareFlowQuery(flowType)
|
||||
stmt, args, err := query.Where(
|
||||
sq.Eq{
|
||||
FlowsTriggersColumnFlowType.identifier(): flowType,
|
||||
@@ -188,7 +188,7 @@ func prepareTriggerActionsQuery() (sq.SelectBuilder, func(*sql.Rows) ([]*Action,
|
||||
}
|
||||
}
|
||||
|
||||
func prepareFlowQuery() (sq.SelectBuilder, func(*sql.Rows) (*Flow, error)) {
|
||||
func prepareFlowQuery(flowType domain.FlowType) (sq.SelectBuilder, func(*sql.Rows) (*Flow, error)) {
|
||||
return sq.Select(
|
||||
ActionColumnID.identifier(),
|
||||
ActionColumnCreationDate.identifier(),
|
||||
@@ -211,6 +211,7 @@ func prepareFlowQuery() (sq.SelectBuilder, func(*sql.Rows) (*Flow, error)) {
|
||||
func(rows *sql.Rows) (*Flow, error) {
|
||||
flow := &Flow{
|
||||
TriggerActions: make(map[domain.TriggerType][]*Action),
|
||||
Type: flowType,
|
||||
}
|
||||
for rows.Next() {
|
||||
var (
|
||||
|
Reference in New Issue
Block a user