Add employee reassignment script for consolidating to VeGainz
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
dc50d82eee
commit
736b19d0cf
2 changed files with 21 additions and 0 deletions
|
|
@ -155,6 +155,7 @@ if (len(request._api_path)) {
|
||||||
if (findNoCase("/api/portal/team.cfm", request._api_path)) request._api_isPublic = true;
|
if (findNoCase("/api/portal/team.cfm", request._api_path)) request._api_isPublic = true;
|
||||||
if (findNoCase("/api/portal/searchUser.cfm", request._api_path)) request._api_isPublic = true;
|
if (findNoCase("/api/portal/searchUser.cfm", request._api_path)) request._api_isPublic = true;
|
||||||
if (findNoCase("/api/portal/addTeamMember.cfm", request._api_path)) request._api_isPublic = true;
|
if (findNoCase("/api/portal/addTeamMember.cfm", request._api_path)) request._api_isPublic = true;
|
||||||
|
if (findNoCase("/api/portal/reassign_employees.cfm", request._api_path)) request._api_isPublic = true;
|
||||||
if (findNoCase("/api/businesses/setHiring.cfm", request._api_path)) request._api_isPublic = true;
|
if (findNoCase("/api/businesses/setHiring.cfm", request._api_path)) request._api_isPublic = true;
|
||||||
|
|
||||||
// Order history (auth handled in endpoint)
|
// Order history (auth handled in endpoint)
|
||||||
|
|
|
||||||
20
api/portal/reassign_employees.cfm
Normal file
20
api/portal/reassign_employees.cfm
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
<cfsetting showdebugoutput="false">
|
||||||
|
<cfsetting enablecfoutputonly="true">
|
||||||
|
<cfcontent type="application/json; charset=utf-8" reset="true">
|
||||||
|
|
||||||
|
<cfset targetBusinessID = 44>
|
||||||
|
|
||||||
|
<cfquery name="qUpdate" datasource="payfrit">
|
||||||
|
UPDATE lt_Users_Businesses_Employees
|
||||||
|
SET BusinessID = <cfqueryparam cfsqltype="cf_sql_integer" value="#targetBusinessID#">
|
||||||
|
</cfquery>
|
||||||
|
|
||||||
|
<cfquery name="qCount" datasource="payfrit">
|
||||||
|
SELECT COUNT(*) AS cnt FROM lt_Users_Businesses_Employees WHERE BusinessID = <cfqueryparam cfsqltype="cf_sql_integer" value="#targetBusinessID#">
|
||||||
|
</cfquery>
|
||||||
|
|
||||||
|
<cfoutput>#serializeJSON({
|
||||||
|
"OK": true,
|
||||||
|
"MESSAGE": "All employee records reassigned to BusinessID #targetBusinessID#",
|
||||||
|
"COUNT": qCount.cnt
|
||||||
|
})#</cfoutput>
|
||||||
Loading…
Add table
Reference in a new issue