Feat v0.3.5 settings icd clone (#19)
All checks were successful
All checks were successful
Co-authored-by: Jeffrey Smith <jasafpro@gmail.com> Co-committed-by: Jeffrey Smith <jasafpro@gmail.com>
This commit was merged in pull request #19.
This commit is contained in:
@@ -406,9 +406,8 @@ func nullIfEmpty(s string) interface{} {
|
||||
func (s *WorkflowStore) CreateInstance(ctx context.Context, inst *models.WorkflowInstance) error {
|
||||
stageData := jsonOrEmpty(inst.StageData)
|
||||
metadata := jsonOrEmpty(inst.Metadata)
|
||||
status := inst.Status
|
||||
if status == "" {
|
||||
status = models.InstanceStatusActive
|
||||
if inst.Status == "" {
|
||||
inst.Status = models.InstanceStatusActive
|
||||
}
|
||||
return DB.QueryRowContext(ctx, `
|
||||
INSERT INTO workflow_instances (workflow_id, workflow_version, current_stage,
|
||||
@@ -416,7 +415,7 @@ func (s *WorkflowStore) CreateInstance(ctx context.Context, inst *models.Workflo
|
||||
VALUES ($1, $2, $3, $4, $5, $6, $7, $8)
|
||||
RETURNING id, stage_entered_at, created_at, updated_at`,
|
||||
inst.WorkflowID, inst.WorkflowVersion, inst.CurrentStage,
|
||||
stageData, status, inst.StartedBy, inst.EntryToken, metadata,
|
||||
stageData, inst.Status, inst.StartedBy, inst.EntryToken, metadata,
|
||||
).Scan(&inst.ID, &inst.StageEnteredAt, &inst.CreatedAt, &inst.UpdatedAt)
|
||||
}
|
||||
|
||||
@@ -575,15 +574,14 @@ func (s *WorkflowStore) ListActiveInstances(ctx context.Context) ([]models.Workf
|
||||
|
||||
func (s *WorkflowStore) CreateAssignment(ctx context.Context, a *models.WorkflowAssignment) error {
|
||||
reviewData := jsonOrEmpty(a.ReviewData)
|
||||
status := a.Status
|
||||
if status == "" {
|
||||
status = models.AssignmentStatusUnassigned
|
||||
if a.Status == "" {
|
||||
a.Status = models.AssignmentStatusUnassigned
|
||||
}
|
||||
return DB.QueryRowContext(ctx, `
|
||||
INSERT INTO workflow_assignments (instance_id, stage, team_id, assigned_to, status, review_data)
|
||||
VALUES ($1, $2, $3, $4, $5, $6)
|
||||
RETURNING id, created_at`,
|
||||
a.InstanceID, a.Stage, a.TeamID, a.AssignedTo, status, reviewData,
|
||||
a.InstanceID, a.Stage, a.TeamID, a.AssignedTo, a.Status, reviewData,
|
||||
).Scan(&a.ID, &a.CreatedAt)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user