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:
parent
89b0f0badf
commit
b56992a995
@ -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 },
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user