026 bug fix
This commit is contained in:
+1
-1
@@ -71,7 +71,7 @@
|
||||
|
||||
//variables.framework.docs={};
|
||||
variables.framework.docs.APIName="Deck API";
|
||||
variables.framework.docs.APIVersion="0.025";
|
||||
variables.framework.docs.APIVersion="0.026";
|
||||
|
||||
variables.framework.globalHeaders = structNew();
|
||||
variables.framework.globalHeaders["Access-Control-Expose-Headers"] = "Location";
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
<cfthrow type="invalidParamValue" message="Cannot find CFS parameter by instanceOperationCfsParamUid=#arguments.instanceOperationCfsParamUid#"/>
|
||||
</cfif>
|
||||
|
||||
<cfset CreateObject("component", "instance_operation_cfs_param_ls").checkParam(local.qCheck.svc_operation_cfs_param_id, arguments.paramValue)/>
|
||||
<cfset CreateObject("component", "instance_operation_cfs_param_ls").checkParam(local.qCheck.svc_operation_cfs_param_id, arguments.paramValue, arguments.instanceOperationCfsParamUid)/>
|
||||
</cffunction>
|
||||
|
||||
</cfcomponent>
|
||||
@@ -225,8 +225,9 @@
|
||||
</cffunction>
|
||||
|
||||
<cffunction name="checkParam">
|
||||
<cfargument name="svcOperationCfsParamId" type="numeric" required=true/>
|
||||
<cfargument name="paramValue" required=true/>
|
||||
<cfargument name="svcOperationCfsParamId" type="numeric" required = true/>
|
||||
<cfargument name="paramValue" required = true/>
|
||||
<cfargument name="instanceOperationCfsParamUid" type="guid" required = false/>
|
||||
<!--- *** Вероятно, стоит возвращать конкретную ругань --->
|
||||
<!--- принадлежит ли параметр к данному сервису, проверяется выше --->
|
||||
<cfquery name="qSvcOperationCfsParam">
|
||||
@@ -269,6 +270,9 @@
|
||||
</cfif>
|
||||
|
||||
<!--- *** интересно, как мы ухитряемся проверить уникальность параметра, если он относится к операции, а не к экземпляру. Нам-то нужна уникальность для стейта (и то, скорее, единовременная, и интересовать будут только успешные операции) --->
|
||||
|
||||
<!--- ****** Внимание! Этот код сравнивает параметры одноименных операций, но уникальность должна быть и между create-modify и т.п. --->
|
||||
|
||||
<cfswitch expression=#qSvcOperationCfsParam.unique_scope#>
|
||||
<cfcase value="provider">
|
||||
<cfquery name="qUnique">
|
||||
@@ -276,11 +280,11 @@
|
||||
from instance_operation_cfs_param p
|
||||
where p.param_value=<cfqueryparam cfsqltype="cf_sql_varchar" value=#arguments.paramValue#/>
|
||||
AND p.svc_operation_cfs_param_id=<cfqueryparam cfsqltype="cf_sql_integer" value=#qSvcOperationCfsParam.svc_operation_cfs_param_id#/>
|
||||
<cfif isValid("guid",qSvcOperationCfsParam.instance_operation_cfs_param_uid)>
|
||||
AND p.instance_operation_cfs_param_uid <> <cfqueryparam cfsqltype="cf_sql_other" value=#qSvcOperationCfsParam.instance_operation_cfs_param_uid# null=#!isValid("guid",qSvcOperationCfsParam.instance_operation_cfs_param_uid)#/>
|
||||
<cfif structKeyExists(arguments,"instanceOperationCfsParamUid")>
|
||||
AND p.instance_operation_cfs_param_uid <> <cfqueryparam cfsqltype="cf_sql_other" value=#arguments.instanceOperationCfsParamUid#/><!--- null=#!isValid("guid",arguments.instanceOperationCfsParamUid)# --->
|
||||
</cfif>
|
||||
</cfquery>
|
||||
<!--- <cfdump var=#qUnique#/> --->
|
||||
<!--- <cfdump var=#qUnique#/><cfabort/> --->
|
||||
<cfif qUnique.cnt GT 0>
|
||||
<!--- <cfreturn '#qSvcOperationCfsParam.svc_operation_cfs_param# = "#arguments.paramValue#" is not unique in the provider scope'/> --->
|
||||
<cfthrow type="invalidParamValue" message='#qSvcOperationCfsParam.svc_operation_cfs_param# = "#arguments.paramValue#" is not unique in the provider scope'/>
|
||||
@@ -300,8 +304,8 @@
|
||||
where p.param_value=<cfqueryparam cfsqltype="cf_sql_varchar" value=#arguments.paramValue#/>
|
||||
AND svc_operation_cfs_param_id=<cfqueryparam cfsqltype="cf_sql_integer" value=#qSvcOperationCfsParam.svc_operation_cfs_param_id#/>
|
||||
AND u.usr_id=<cfqueryparam cfsqltype="cf_sql_integer" value=#request.usr_id#/>
|
||||
<cfif isValid("guid",qSvcOperationCfsParam.instance_operation_cfs_param_uid)>
|
||||
AND p.instance_operation_cfs_param_uid <> <cfqueryparam cfsqltype="cf_sql_other" value=#qSvcOperationCfsParam.instance_operation_cfs_param_uid# null=#!isValid("guid",qSvcOperationCfsParam.instance_operation_cfs_param_uid)#/>
|
||||
<cfif structKeyExists(arguments,"instanceOperationCfsParamUid")>
|
||||
AND p.instance_operation_cfs_param_uid <> <cfqueryparam cfsqltype="cf_sql_other" value=#arguments.instanceOperationCfsParamUid#/> <!--- null=#!isValid("guid",arguments.instanceOperationCfsParamUid)# --->
|
||||
</cfif>
|
||||
</cfquery>
|
||||
<!--- <cfdump var=#qUnique#/> --->
|
||||
|
||||
Reference in New Issue
Block a user