|
@@ -13,7 +13,7 @@ import { pgClient } from '../../db/pg-instance'
|
|
|
export function defineAuthingDepartSync(){
|
|
|
// function defineAuthingLogin(){
|
|
|
Parse.Cloud.define("authingDepartSync", async (request) => {
|
|
|
- let result = await syncOrganizationsFromAuthing(token)
|
|
|
+ let result = await syncOrganizationsFromAuthing()
|
|
|
return result
|
|
|
});
|
|
|
}
|
|
@@ -81,7 +81,7 @@ async function InsertAllDepartment(departList){
|
|
|
let flattenedParams = rowData.flat();
|
|
|
|
|
|
let syncDepartSQL = `
|
|
|
- INSERT INTO "_Session" ("objectId", "organizationCode", "name", "description","branch","parent","code", "status","createdAt","updatedAt")
|
|
|
+ INSERT INTO "Department" ("objectId", "organizationCode", "name", "description","branch","parent","code", "status","createdAt","updatedAt")
|
|
|
VALUES
|
|
|
${rowData.map((_, i) => `($${i * 5 + 1}, $${i * 5 + 2}, $${i * 5 + 3}, $${i * 5 + 4}, $${i * 5 + 5}, $${i * 5 + 6}, $${i * 5 + 7}, $${i * 5 + 8}, $${i * 5 + 9}, $${i * 5 + 10})`).join(',\n')}
|
|
|
ON CONFLICT ("objectId") DO UPDATE
|