mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 11:04:25 +00:00
fix: return flow type (#2563)
This commit is contained in:
parent
f5661c6e61
commit
686c0edb5c
@ -51,7 +51,7 @@ type Flow struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (q *Queries) GetFlow(ctx context.Context, flowType domain.FlowType, orgID string) (*Flow, error) {
|
func (q *Queries) GetFlow(ctx context.Context, flowType domain.FlowType, orgID string) (*Flow, error) {
|
||||||
query, scan := q.prepareFlowQuery()
|
query, scan := q.prepareFlowQuery(flowType)
|
||||||
stmt, args, err := query.Where(
|
stmt, args, err := query.Where(
|
||||||
sq.Eq{
|
sq.Eq{
|
||||||
FlowsTriggersColumnFlowType.identifier(): flowType,
|
FlowsTriggersColumnFlowType.identifier(): flowType,
|
||||||
@ -172,7 +172,7 @@ func (q *Queries) prepareTriggerActionsQuery() (sq.SelectBuilder, func(*sql.Rows
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (q *Queries) prepareFlowQuery() (sq.SelectBuilder, func(*sql.Rows) (*Flow, error)) {
|
func (q *Queries) prepareFlowQuery(flowType domain.FlowType) (sq.SelectBuilder, func(*sql.Rows) (*Flow, error)) {
|
||||||
return sq.Select(
|
return sq.Select(
|
||||||
ActionColumnID.identifier(),
|
ActionColumnID.identifier(),
|
||||||
ActionColumnCreationDate.identifier(),
|
ActionColumnCreationDate.identifier(),
|
||||||
@ -190,6 +190,7 @@ func (q *Queries) prepareFlowQuery() (sq.SelectBuilder, func(*sql.Rows) (*Flow,
|
|||||||
PlaceholderFormat(sq.Dollar),
|
PlaceholderFormat(sq.Dollar),
|
||||||
func(rows *sql.Rows) (*Flow, error) {
|
func(rows *sql.Rows) (*Flow, error) {
|
||||||
flow := &Flow{
|
flow := &Flow{
|
||||||
|
Type: flowType,
|
||||||
TriggerActions: make(map[domain.TriggerType][]*Action),
|
TriggerActions: make(map[domain.TriggerType][]*Action),
|
||||||
}
|
}
|
||||||
for rows.Next() {
|
for rows.Next() {
|
||||||
|
Loading…
Reference in New Issue
Block a user