mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-27 19:42:11 +10:00
Expose which transitions lead to request
This commit is contained in:
parent
419dbb05d8
commit
c33afc9b0c
2 changed files with 4 additions and 6 deletions
|
|
@ -3,7 +3,7 @@ import isUndefined from 'lodash/isUndefined';
|
|||
import config from '../config';
|
||||
import { denormalisedResponseEntities, ensureOwnListing } from '../util/data';
|
||||
import { storableError } from '../util/errors';
|
||||
import { TRANSITION_REQUEST, TRANSITION_REQUEST_AFTER_ENQUIRY } from '../util/transaction';
|
||||
import { transitionsToRequested } from '../util/transaction';
|
||||
import { LISTING_STATE_DRAFT } from '../util/types';
|
||||
import * as log from '../util/log';
|
||||
import { authInfo } from './Auth.duck';
|
||||
|
|
@ -316,7 +316,7 @@ export const fetchCurrentUserNotifications = () => (dispatch, getState, sdk) =>
|
|||
|
||||
const apiQueryParams = {
|
||||
only: 'sale',
|
||||
last_transitions: [TRANSITION_REQUEST, TRANSITION_REQUEST_AFTER_ENQUIRY],
|
||||
last_transitions: transitionsToRequested,
|
||||
page: 1,
|
||||
per_page: NOTIFICATION_PAGE_SIZE,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -56,10 +56,8 @@ const txLastTransition = tx => ensureTransaction(tx).attributes.lastTransition;
|
|||
|
||||
export const txIsEnquired = tx => txLastTransition(tx) === TRANSITION_ENQUIRE;
|
||||
|
||||
export const txIsRequested = tx => {
|
||||
const transition = txLastTransition(tx);
|
||||
return transition === TRANSITION_REQUEST || transition === TRANSITION_REQUEST_AFTER_ENQUIRY;
|
||||
};
|
||||
export const transitionsToRequested = [TRANSITION_REQUEST, TRANSITION_REQUEST_AFTER_ENQUIRY];
|
||||
export const txIsRequested = tx => transitionsToRequested.includes(txLastTransition(tx));
|
||||
|
||||
export const txIsAccepted = tx => txLastTransition(tx) === TRANSITION_ACCEPT;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue