- Introduced a new input for capturing the surname of the user during contact addition. - Updated the contact parsing logic to include surname alongside name and phone number. - Modified the customer creation and update processes to accommodate surname, ensuring full name is used in confirmation messages. - Adjusted localization files to reflect the new surname input prompt and updated confirmation messages. - Refactored components to utilize a unified method for retrieving full customer names, improving consistency across the application.
10 lines
388 B
TypeScript
10 lines
388 B
TypeScript
import type * as GQL from '../../graphql/types';
|
|
|
|
export function getCustomerFullName(customer: GQL.CustomerFieldsFragment) {
|
|
return [customer?.name?.trim(), customer?.surname?.trim()].filter(Boolean).join(' ');
|
|
}
|
|
|
|
export function isCustomerBanned(customer: GQL.CustomerFieldsFragment): boolean {
|
|
return Boolean(customer.bannedUntil && new Date() < new Date(customer.bannedUntil));
|
|
}
|