chore: small PR fixes
This commit is contained in:
parent
8700ebcbe1
commit
d00743446b
1 changed files with 3 additions and 3 deletions
|
|
@ -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}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue