Merge branch 'main' into next

This commit is contained in:
GitHub Actions Bot 2024-07-24 08:22:44 +00:00
commit fe2a679132
2 changed files with 5 additions and 1 deletions

View File

@ -51,7 +51,9 @@ async function importXlsxAction(ctx: Context, next: Next) {
explain: (ctx.request.body as any).explain, explain: (ctx.request.body as any).explain,
}); });
const importedCount = await importer.run(); const importedCount = await importer.run({
context: ctx,
});
ctx.bodyMeta = { successCount: importedCount }; ctx.bodyMeta = { successCount: importedCount };
ctx.body = ctx.bodyMeta; ctx.body = ctx.bodyMeta;

View File

@ -30,6 +30,7 @@ type ImporterOptions = {
type RunOptions = { type RunOptions = {
transaction?: Transaction; transaction?: Transaction;
context?: any;
}; };
export class XlsxImporter extends EventEmitter { export class XlsxImporter extends EventEmitter {
@ -180,6 +181,7 @@ export class XlsxImporter extends EventEmitter {
await this.options.collection.repository.create({ await this.options.collection.repository.create({
values: rowValues, values: rowValues,
context: options?.context,
transaction, transaction,
}); });