fix(medusa): Remove atomicPhase usage in OAuthService (#2249)

This commit is contained in:
Sebastian Rindom authored and GitHub committed 2022-09-26 11:09:45 +02:00
1 parent 74342fc1ea
commit 7e56935e7a
1 file changed
+2 -6
+2 -6
View File
@@ -79,8 +79,7 @@ class Oauth extends TransactionBaseService {
}
async create(data: CreateOauthInput): Promise<OAuthModel> {
return await this.atomicPhase_(async (manager) => {
const repo = manager.getCustomRepository(this.oauthRepository_)
const repo = this.manager.getCustomRepository(this.oauthRepository_)
const application = repo.create({
display_name: data.display_name,
@@ -90,12 +89,10 @@ class Oauth extends TransactionBaseService {
})
return await repo.save(application)
})
}
async update(id: string, update: UpdateOauthInput): Promise<OAuthModel> {
return await this.atomicPhase_(async (manager) => {
const repo = manager.getCustomRepository(this.oauthRepository_)
const repo = this.manager.getCustomRepository(this.oauthRepository_)
const oauth = await this.retrieve(id)
if ("data" in update) {
@@ -103,7 +100,6 @@ class Oauth extends TransactionBaseService {
}
return await repo.save(oauth)
})
}
async registerOauthApp(appDetails: CreateOauthInput): Promise<OAuthModel> {