flow-widget 인라인 편집 시 changed_by에 사용자 ID 기록되도록 수정
This commit is contained in:
@@ -360,7 +360,17 @@ export class FlowExecutionService {
|
|||||||
console.log(`📝 [updateStepData] Query: ${updateQuery}`);
|
console.log(`📝 [updateStepData] Query: ${updateQuery}`);
|
||||||
console.log(`📝 [updateStepData] Params:`, params);
|
console.log(`📝 [updateStepData] Params:`, params);
|
||||||
|
|
||||||
await db.query(updateQuery, params);
|
// 트랜잭션으로 감싸서 사용자 ID 세션 변수 설정 후 업데이트 실행
|
||||||
|
// (트리거에서 changed_by를 기록하기 위함)
|
||||||
|
await db.query("BEGIN");
|
||||||
|
try {
|
||||||
|
await db.query(`SET LOCAL app.user_id = '${userId}'`);
|
||||||
|
await db.query(updateQuery, params);
|
||||||
|
await db.query("COMMIT");
|
||||||
|
} catch (txError) {
|
||||||
|
await db.query("ROLLBACK");
|
||||||
|
throw txError;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(`✅ [updateStepData] Data updated successfully: ${tableName}.${primaryKeyColumn}=${recordId}`, {
|
console.log(`✅ [updateStepData] Data updated successfully: ${tableName}.${primaryKeyColumn}=${recordId}`, {
|
||||||
|
|||||||
Reference in New Issue
Block a user