mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-28 20:53:24 +10:00
Merge pull request #1067 from sharetribe/inbox-page-uses-sparse-fields
InboxPage: use sparse fields to improve query performance
This commit is contained in:
commit
0f9c74be68
3 changed files with 13 additions and 2 deletions
|
|
@ -14,6 +14,9 @@ way to update this template, but currently, we follow a pattern:
|
|||
|
||||
## Upcoming version 2019-XX-XX
|
||||
|
||||
- [add] Use sparse fields on InboxPage query to reduce data load.
|
||||
[#1067](https://github.com/sharetribe/flex-template-web/pull/1067)
|
||||
- NOTE: if you need more fields on `InboxPage`, you need to add those to `loadData` function.
|
||||
- [add] Use sparse fields on SearchPage to reduce data load.
|
||||
[#1066](https://github.com/sharetribe/flex-template-web/pull/1066)
|
||||
- NOTE: if you need more fields on `ListingCard` than title, price and geolocation - you need to
|
||||
|
|
|
|||
|
|
@ -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