mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-26 06:47:17 +10:00
InboxPage: use sparse fields to improve query performance
This commit is contained in:
parent
d31055f263
commit
be0c8a7cf5
2 changed files with 10 additions and 2 deletions
|
|
@ -94,6 +94,14 @@ export const loadData = (params, search) => (dispatch, getState, sdk) => {
|
|||
only: onlyFilter,
|
||||
lastTransitions: TRANSITIONS,
|
||||
include: ['provider', 'provider.profileImage', 'customer', 'customer.profileImage', 'booking'],
|
||||
'fields.transaction': [
|
||||
'lastTransition',
|
||||
'lastTransitionedAt',
|
||||
'transitions',
|
||||
'payinTotal',
|
||||
'payoutTotal',
|
||||
],
|
||||
'fields.user': ['profile.displayName', 'profile.abbreviatedName'],
|
||||
'fields.image': ['variants.square-small', 'variants.square-small2x'],
|
||||
page,
|
||||
per_page: INBOX_PAGE_SIZE,
|
||||
|
|
|
|||
|
|
@ -339,7 +339,7 @@ propTypes.transaction = shape({
|
|||
id: propTypes.uuid.isRequired,
|
||||
type: propTypes.value('transaction').isRequired,
|
||||
attributes: shape({
|
||||
createdAt: instanceOf(Date).isRequired,
|
||||
createdAt: instanceOf(Date),
|
||||
lastTransitionedAt: instanceOf(Date).isRequired,
|
||||
lastTransition: oneOf(TRANSITIONS).isRequired,
|
||||
|
||||
|
|
@ -357,7 +357,7 @@ propTypes.transaction = shape({
|
|||
lineTotal: propTypes.money.isRequired,
|
||||
reversal: bool.isRequired,
|
||||
})
|
||||
).isRequired,
|
||||
),
|
||||
transitions: arrayOf(propTypes.transition).isRequired,
|
||||
}),
|
||||
booking: propTypes.booking,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue