feat: refs #6897 add EntryConfig model and enhance entry filtering with new parameters #3366

Merged
pablone merged 15 commits from 6897-refactorEntryBuyList into dev 2025-02-12 06:37:44 +00:00
1 changed files with 4 additions and 4 deletions
Showing only changes of commit 6110295cc2 - Show all commits

View File

@ -24,7 +24,6 @@ module.exports = Self => {
const userId = ctx.req.accessToken.userId;
const myOptions = {userId};
let tx;
let result;
if (typeof options == 'object')
Object.assign(myOptions, options);
@ -32,12 +31,13 @@ module.exports = Self => {
tx = await Self.beginTransaction({});
myOptions.transaction = tx;
}
try {
result = await Self.rawSql('CALL entry_clone(?)', [id], myOptions);
await Self.rawSql('CALL entry_clone(?, @newEntryId)', [id], myOptions);
const result = await Self.rawSql('SELECT @newEntryId', [], myOptions);
const newEntryId = result[0]['@newEntryId'];
if (tx) await tx.commit();
return result[0];
return newEntryId;
} catch (e) {
if (tx) await tx.rollback();
throw e;