mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-01 13:33:48 +08:00
fix: propagate publish release flag through Go agent endpoints (#17347)
This commit is contained in:
@@ -291,7 +291,22 @@ func (h *AgentHandler) GetAgent(c *gin.Context) {
|
||||
if row != nil {
|
||||
row.DSL = dslpkg.NormalizeForCanvas(row.DSL)
|
||||
}
|
||||
common.SuccessWithData(c, row, "success")
|
||||
// Attach last_publish_time so the front-end can render when the agent
|
||||
// was last published (Python get_agent parity).
|
||||
lastPublishTime, err := h.agentService.GetLastPublishTime(c.Request.Context(), canvasID)
|
||||
if err != nil {
|
||||
ec, em := mapAgentError(err)
|
||||
common.ResponseWithCodeData(c, ec, nil, em)
|
||||
return
|
||||
}
|
||||
common.SuccessWithData(c, &agentDetailResponse{UserCanvas: row, LastPublishTime: lastPublishTime}, "success")
|
||||
}
|
||||
|
||||
// agentDetailResponse wraps the canvas row with derived fields that Python's
|
||||
// get_agent handler adds to the response.
|
||||
type agentDetailResponse struct {
|
||||
*entity.UserCanvas
|
||||
LastPublishTime *int64 `json:"last_publish_time,omitempty"`
|
||||
}
|
||||
|
||||
// updateAgentRequest is the wire shape for PUT /api/v1/agents/:canvas_id.
|
||||
|
||||
Reference in New Issue
Block a user