From d191be03e885bd197ff0fdd3a63bc8abf8634641 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Sat, 20 Sep 2025 11:53:30 +0300 Subject: [PATCH] Refactor welcome feature to use RegistrationService for customer retrieval - Replaced CustomersService with RegistrationService in the welcome feature to streamline customer data retrieval. - Updated the command handler to ensure proper integration with the new service. --- apps/bot/src/bot/features/welcome.ts | 6 +++--- packages/graphql/api/customers.ts | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/bot/src/bot/features/welcome.ts b/apps/bot/src/bot/features/welcome.ts index cd6abcb..2f66bff 100644 --- a/apps/bot/src/bot/features/welcome.ts +++ b/apps/bot/src/bot/features/welcome.ts @@ -2,7 +2,7 @@ import { type Context } from '@/bot/context'; import { logHandle } from '@/bot/helpers/logging'; import { KEYBOARD_SHARE_PHONE, mainMenu } from '@/config/keyboards'; import { combine } from '@/utils/messages'; -import { CustomersService } from '@repo/graphql/api/customers'; +import { RegistrationService } from '@repo/graphql/api/registration'; import { Composer } from 'grammy'; const composer = new Composer(); @@ -12,8 +12,8 @@ const feature = composer.chatType('private'); feature.command('start', logHandle('command-start'), async (ctx) => { const telegramId = ctx.from.id; - const customerService = new CustomersService({ telegramId }); - const { customer } = await customerService.getCustomer({ telegramId }); + const registrationService = new RegistrationService(); + const { customer } = await registrationService.getCustomer({ telegramId }); if (customer) { // Пользователь уже зарегистрирован — приветствуем diff --git a/packages/graphql/api/customers.ts b/packages/graphql/api/customers.ts index acbcfbb..6ad7f77 100644 --- a/packages/graphql/api/customers.ts +++ b/packages/graphql/api/customers.ts @@ -46,8 +46,6 @@ export class CustomersService extends BaseService { } async getCustomer(variables: VariablesOf) { - await this.checkIsBanned(); - const { query } = await getClientWithToken(); const result = await query({