Skip to content

Commit b534305

Browse files
committed
fix: transaction
1 parent 850410c commit b534305

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/common/profile/import.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -382,11 +382,11 @@ export const importUserExperienceFromJSON = async ({
382382
)
383383
.parse(dataJson);
384384

385-
const transactionFn = transaction
386-
? con.transaction
387-
: async <T>(callback: (entityManager: EntityManager) => Promise<T>) => {
388-
return callback(con);
389-
};
385+
const transactionFn = async <T>(
386+
callback: (entityManager: EntityManager) => Promise<T>,
387+
) => {
388+
return transaction ? con.transaction(callback) : callback(con);
389+
};
390390

391391
await transactionFn(async (entityManager) => {
392392
for (const item of data) {

0 commit comments

Comments
 (0)