fix: Correct issues related to chat_flow_role version query
This commit is contained in:
@ -3915,11 +3915,9 @@ func (w *ApplicationService) GetChatFlowRole(ctx context.Context, req *workflow.
|
||||
|
||||
var version string
|
||||
if wf.Meta.AppID != nil {
|
||||
vl, err := GetWorkflowDomainSVC().GetWorkflowVersionsByConnector(ctx, mustParseInt64(req.GetConnectorID()), wf.ID, 1)
|
||||
if err != nil {
|
||||
if vl, err := GetWorkflowDomainSVC().GetWorkflowVersionsByConnector(ctx, mustParseInt64(req.GetConnectorID()), wf.ID, 1); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(vl) > 0 {
|
||||
} else if len(vl) > 0 {
|
||||
version = vl[0]
|
||||
}
|
||||
}
|
||||
|
||||
@ -748,11 +748,9 @@ func (r *RepositoryImpl) GetVersion(ctx context.Context, id int64, version strin
|
||||
}
|
||||
|
||||
func (r *RepositoryImpl) GetVersionListByConnectorAndWorkflowID(ctx context.Context, connectorID, workflowID int64, limit int) (_ []string, err error) {
|
||||
defer func() {
|
||||
if err != nil {
|
||||
err = vo.WrapIfNeeded(errno.ErrDatabaseError, err)
|
||||
}
|
||||
}()
|
||||
if limit <= 0 {
|
||||
return nil, vo.WrapError(errno.ErrInvalidParameter, errors.New("limit must be greater than 0"))
|
||||
}
|
||||
|
||||
connectorWorkflowVersion := r.query.ConnectorWorkflowVersion
|
||||
vl, err := connectorWorkflowVersion.WithContext(ctx).
|
||||
|
||||
Reference in New Issue
Block a user