fix registration error

This commit is contained in:
vchikalkin 2025-10-08 22:43:24 +03:00
parent 0a43d63c2c
commit d32a7dc54e

View File

@ -3,7 +3,6 @@ import { logHandle } from '@/bot/helpers/logging';
import { KEYBOARD_REMOVE, mainMenu } from '@/config/keyboards';
import { parseContact } from '@/utils/contact';
import { isValidPhoneNumber, normalizePhoneNumber } from '@/utils/phone';
import { CustomersService } from '@repo/graphql/api/customers';
import { RegistrationService } from '@repo/graphql/api/registration';
import { Composer } from 'grammy';
@ -18,8 +17,8 @@ feature.on(':contact', logHandle('contact-registration'), async (ctx) => {
const { name, surname } = parseContact(contact);
// Проверяем, не зарегистрирован ли уже пользователь
const customerService = new CustomersService({ telegramId });
const { customer: existingCustomer } = await customerService.getCustomer({ telegramId });
const registrationService = new RegistrationService();
const { customer: existingCustomer } = await registrationService.getCustomer({ telegramId });
if (existingCustomer) {
return ctx.reply(ctx.t('msg-already-registered'), {
@ -39,8 +38,6 @@ feature.on(':contact', logHandle('contact-registration'), async (ctx) => {
return ctx.reply(ctx.t('msg-invalid-phone'));
}
const registrationService = new RegistrationService();
try {
const { customer } = await registrationService.getCustomer({ phone });