fix: add activity logging for existing records fetched during database sync process
Deploy Application / deploy (push) Successful in 36s
Details
Deploy Application / deploy (push) Successful in 36s
Details
This commit is contained in:
parent
f248c5889f
commit
d7031052ea
|
|
@ -133,15 +133,20 @@ async function processDatabaseSync(database: any) {
|
|||
);
|
||||
dbInserted += ops.length;
|
||||
} else {
|
||||
// Check existing records in bulk instead of one by one
|
||||
const invoiceIds = ops.map((op) => op.c_invoice_id).filter(Boolean);
|
||||
const existingRecords = await db.rv_openitem.findMany({
|
||||
where: {
|
||||
db_id: database.db_id,
|
||||
},
|
||||
select: { id: true, c_invoice_id: true },
|
||||
});
|
||||
|
||||
await db.activity_logs.create({
|
||||
data: {
|
||||
action: "sync_rv_openitem",
|
||||
status: "info",
|
||||
message: `Existing records fetched: ${existingRecords.length}`,
|
||||
// extra_json: database,
|
||||
},
|
||||
});
|
||||
for (const op of ops) {
|
||||
const removeSpace = (string: string) => {
|
||||
return string
|
||||
|
|
|
|||
Loading…
Reference in New Issue