fix(registration): improve error handling for customer creation

- Updated error handling in the registration feature to return a generic error message when documentId is not present, enhancing user experience by providing clearer feedback.
This commit is contained in:
vchikalkin 2025-08-21 18:48:41 +03:00
parent 89b0f0badf
commit b56992a995

View File

@ -60,9 +60,7 @@ feature.on(':contact', logHandle('contact-registration'), async (ctx) => {
const response = await registrationService.createCustomer({ name, phone, telegramId });
const documentId = response?.createCustomer?.documentId;
if (!documentId) {
throw new Error('Не удалось создать клиента: отсутствует documentId');
}
if (!documentId) return ctx.reply(ctx.t('err-generic'));
await registrationService.updateCustomer({
data: { active: true },