fix(medusa): Remove atomicPhase usage in OAuthService (#2249)
This commit is contained in:
1 parent
74342fc1ea
commit
7e56935e7a
1 file changed
+2
-6
@@ -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> {
|
||||
|
||||
Reference in new issue
Block a user