Changeset 0.28.2 (#183)
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
|
||||
"git.gobha.me/xcaliber/chat-switchboard/database"
|
||||
"git.gobha.me/xcaliber/chat-switchboard/events"
|
||||
"git.gobha.me/xcaliber/chat-switchboard/notifications"
|
||||
)
|
||||
|
||||
// ── Workflow Assignment Handler ─────────────
|
||||
@@ -143,6 +144,15 @@ func (h *WorkflowAssignmentHandler) Claim(c *gin.Context) {
|
||||
})
|
||||
}
|
||||
|
||||
// Persist notification for bell/inbox (v0.28.2)
|
||||
if svc := notifications.Default(); svc != nil {
|
||||
var channelID string
|
||||
_ = database.DB.QueryRowContext(c.Request.Context(),
|
||||
database.Q(`SELECT channel_id FROM workflow_assignments WHERE id = $1`),
|
||||
assignmentID).Scan(&channelID)
|
||||
notifications.NotifyWorkflowClaimed(svc, userID, assignmentID, channelID)
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{"claimed": true, "assignment_id": assignmentID})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user