use serial id
This commit is contained in:
parent
c221ee8cb2
commit
3a6dcb6d77
1 changed files with 3 additions and 3 deletions
|
|
@ -60,8 +60,8 @@ export default class {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
GetApplicationUserIfExists(application: Application, userIdentifier: string, entityManager = this.DB): Promise<ApplicationUser | null> {
|
async GetApplicationUserIfExists(application: Application, userIdentifier: string, entityManager = this.DB): Promise<ApplicationUser | null> {
|
||||||
return entityManager.getRepository(ApplicationUser).findOne({ where: { identifier: userIdentifier, application: application } })
|
return entityManager.getRepository(ApplicationUser).findOne({ where: { identifier: userIdentifier, application: { serial_id: application.serial_id } } })
|
||||||
}
|
}
|
||||||
|
|
||||||
async GetOrCreateApplicationUser(application: Application, userIdentifier: string, balance: number, entityManager = this.DB): Promise<{ user: ApplicationUser, created: boolean }> {
|
async GetOrCreateApplicationUser(application: Application, userIdentifier: string, balance: number, entityManager = this.DB): Promise<{ user: ApplicationUser, created: boolean }> {
|
||||||
|
|
@ -75,7 +75,7 @@ export default class {
|
||||||
async GetApplicationUser(application: Application, userIdentifier: string, entityManager = this.DB): Promise<ApplicationUser> {
|
async GetApplicationUser(application: Application, userIdentifier: string, entityManager = this.DB): Promise<ApplicationUser> {
|
||||||
const found = await this.GetApplicationUserIfExists(application, userIdentifier, entityManager)
|
const found = await this.GetApplicationUserIfExists(application, userIdentifier, entityManager)
|
||||||
if (!found) {
|
if (!found) {
|
||||||
getLogger({ appName: application.name })("user", userIdentifier, "not found")
|
getLogger({ appName: application.name })("user", userIdentifier, "not found", application.name)
|
||||||
throw new Error(`application user not found`)
|
throw new Error(`application user not found`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue