From e3c32a565069bdfe9941681c0f1849328345ce9f Mon Sep 17 00:00:00 2001 From: hatim Date: Mon, 15 May 2023 15:26:34 +0200 Subject: [PATCH] create user if not exist --- src/services/main/applicationManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/main/applicationManager.ts b/src/services/main/applicationManager.ts index 8e699c91..6d8b60ac 100644 --- a/src/services/main/applicationManager.ts +++ b/src/services/main/applicationManager.ts @@ -120,7 +120,7 @@ export default class { async SendAppUserToAppUserPayment(appId: string, req: Types.SendAppUserToAppUserPaymentRequest): Promise { const fromUser = await this.storage.applicationStorage.GetApplicationUser(appId, req.from_user_identifier) - const toUser = await this.storage.applicationStorage.GetApplicationUser(appId, req.to_user_identifier) + const toUser = await this.storage.applicationStorage.GetOrCreateApplicationUser(appId, req.to_user_identifier, 0) const app = await this.storage.applicationStorage.GetApplication(appId) await this.paymentManager.SendUserToUserPayment(fromUser.user.user_id, toUser.user.user_id, req.amount, app) }