chore: small PR fixes

This commit is contained in:
Rafael Taranto 2025-06-05 10:15:28 +01:00
parent 8700ebcbe1
commit d00743446b

View file

@ -88,7 +88,7 @@ const Customers = () => {
const [showCreationModal, setShowCreationModal] = useState(false) const [showCreationModal, setShowCreationModal] = useState(false)
const { data: customersResponse, loading: customerLoading } = const { data: customersResponse, loading: customersLoading } =
useQuery(GET_CUSTOMERS) useQuery(GET_CUSTOMERS)
const [createNewCustomer] = useMutation(CREATE_CUSTOMER, { const [createNewCustomer] = useMutation(CREATE_CUSTOMER, {
@ -112,7 +112,7 @@ const Customers = () => {
const byAuthorized = c => (c.authorizedStatus.label === 'Pending' ? 0 : 1) const byAuthorized = c => (c.authorizedStatus.label === 'Pending' ? 0 : 1)
const byLastActive = c => new Date(R.prop('lastActive', c) ?? '0') const byLastActive = c => new Date(R.prop('lastActive', c) ?? '0')
const customers = R.path(['customers'])(customersResponse) ?? [] const customers = R.path(['customers'])(customersResponse)
const customersData = R.pipe( const customersData = R.pipe(
R.map(setAuthorizedStatus), R.map(setAuthorizedStatus),
R.sortWith([R.ascend(byAuthorized), R.descend(byLastActive)]), R.sortWith([R.ascend(byAuthorized), R.descend(byLastActive)]),
@ -138,7 +138,7 @@ const Customers = () => {
data={customersData} data={customersData}
country={locale?.country} country={locale?.country}
onClick={handleCustomerClicked} onClick={handleCustomerClicked}
loading={customerLoading} loading={customersLoading}
/> />
<CreateCustomerModal <CreateCustomerModal
showModal={showCreationModal} showModal={showCreationModal}