fix: update database sync process to improve record filtering and logging details
Deploy Application / deploy (push) Successful in 36s
Details
Deploy Application / deploy (push) Successful in 36s
Details
This commit is contained in:
parent
1ee8c91611
commit
2425144d6c
|
|
@ -137,7 +137,6 @@ async function processDatabaseSync(database: any) {
|
||||||
const invoiceIds = ops.map((op) => op.c_invoice_id).filter(Boolean);
|
const invoiceIds = ops.map((op) => op.c_invoice_id).filter(Boolean);
|
||||||
const existingRecords = await db.rv_openitem.findMany({
|
const existingRecords = await db.rv_openitem.findMany({
|
||||||
where: {
|
where: {
|
||||||
c_invoice_id: { in: invoiceIds },
|
|
||||||
db_id: database.db_id,
|
db_id: database.db_id,
|
||||||
},
|
},
|
||||||
select: { id: true, c_invoice_id: true },
|
select: { id: true, c_invoice_id: true },
|
||||||
|
|
@ -204,7 +203,7 @@ async function processDatabaseSync(database: any) {
|
||||||
action: "sync_rv_openitem",
|
action: "sync_rv_openitem",
|
||||||
status: "success",
|
status: "success",
|
||||||
message: `Completed sync for database ${database.name} (${database.db_id})`,
|
message: `Completed sync for database ${database.name} (${database.db_id})`,
|
||||||
extra_json: database,
|
extra_json: { database, inserted: dbInserted, updated: dbUpdated },
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue