Changeset 0.27.1 (#167)
This commit is contained in:
@@ -221,23 +221,27 @@ func CreateWorkflowStageNote(ctx context.Context, stores store.Stores, channelID
|
||||
}
|
||||
|
||||
// CreateWorkflowAssignment creates an unassigned workflow assignment entry.
|
||||
func CreateWorkflowAssignment(ctx context.Context, channelID string, stage int, teamID string) {
|
||||
// Returns the assignment ID (for round-robin auto-assignment).
|
||||
func CreateWorkflowAssignment(ctx context.Context, channelID string, stage int, teamID string) string {
|
||||
id := store.NewID()
|
||||
if database.IsSQLite() {
|
||||
id := store.NewID()
|
||||
_, err := database.DB.ExecContext(ctx, `
|
||||
INSERT INTO workflow_assignments (id, channel_id, stage, team_id)
|
||||
VALUES (?, ?, ?, ?)
|
||||
`, id, channelID, stage, teamID)
|
||||
if err != nil {
|
||||
log.Printf("⚠️ Failed to create workflow assignment: %v", err)
|
||||
return ""
|
||||
}
|
||||
return
|
||||
return id
|
||||
}
|
||||
_, err := database.DB.ExecContext(ctx, `
|
||||
INSERT INTO workflow_assignments (channel_id, stage, team_id)
|
||||
VALUES ($1, $2, $3)
|
||||
`, channelID, stage, teamID)
|
||||
INSERT INTO workflow_assignments (id, channel_id, stage, team_id)
|
||||
VALUES ($1, $2, $3, $4)
|
||||
`, id, channelID, stage, teamID)
|
||||
if err != nil {
|
||||
log.Printf("⚠️ Failed to create workflow assignment: %v", err)
|
||||
return ""
|
||||
}
|
||||
return id
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user