Use compact unlabeled filter rows across Super Admin lists.
Also ship pending add-customer name flexibility, store-gated e-payment settings, and logo-only customer login branding. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
29a190f02a
commit
15aad9f9d8
@@ -70,14 +70,20 @@ export function AddCustomerModal({ open, onClose, onCreated }: AddCustomerModalP
|
||||
if (!mounted) return null
|
||||
|
||||
const canSubmit =
|
||||
firstName.trim().length >= 2 &&
|
||||
lastName.trim().length >= 2 &&
|
||||
(firstName.trim().length >= 1 || lastName.trim().length >= 1) &&
|
||||
toE164CellNumber(cellNumber.trim()).length > 0
|
||||
|
||||
async function handleSubmit() {
|
||||
const normalizedCell = toE164CellNumber(cellNumber.trim())
|
||||
if (!canSubmit || !normalizedCell) return
|
||||
|
||||
const trimmedFirst = firstName.trim()
|
||||
const trimmedLast = lastName.trim()
|
||||
if (!trimmedFirst && !trimmedLast) {
|
||||
setError(t('customers.addModal.errorNameRequired'))
|
||||
return
|
||||
}
|
||||
|
||||
const trimmedPassword = password.trim()
|
||||
if (trimmedPassword || passwordConfirm.trim()) {
|
||||
if (trimmedPassword.length < 8) {
|
||||
@@ -105,8 +111,8 @@ export function AddCustomerModal({ open, onClose, onCreated }: AddCustomerModalP
|
||||
try {
|
||||
const created = await createCustomer({
|
||||
cellNumber: normalizedCell,
|
||||
firstName: firstName.trim(),
|
||||
lastName: lastName.trim(),
|
||||
...(trimmedFirst ? { firstName: trimmedFirst } : {}),
|
||||
...(trimmedLast ? { lastName: trimmedLast } : {}),
|
||||
...(trimmedFirstEn ? { firstNameEn: trimmedFirstEn } : {}),
|
||||
...(trimmedLastEn ? { lastNameEn: trimmedLastEn } : {}),
|
||||
...(trimmedPassword ? { password: trimmedPassword } : {}),
|
||||
|
||||
Reference in New Issue
Block a user