Add open flag to all listing prop types

This commit is contained in:
Kimmo Puputti 2017-08-30 15:59:42 +03:00
parent ad48ea3343
commit 63e06d0701
5 changed files with 5 additions and 16 deletions

View file

@ -164,7 +164,7 @@ ManageListingsPageComponent.propTypes = {
currentUser: propTypes.currentUser,
currentUserHasListings: bool.isRequired,
isAuthenticated: bool.isRequired,
listings: arrayOf(propTypes.ownListing),
listings: arrayOf(propTypes.listing),
logoutError: instanceOf(Error),
notificationCount: number,
onCloseListing: func.isRequired,

View file

@ -116,6 +116,7 @@ exports[`OrderPage matches snapshot 1`] = `
"lat": 40,
"lng": 60,
},
"open": true,
"price": Money {
"amount": 5500,
"currency": "USD",

View file

@ -120,6 +120,7 @@ exports[`SalePage matches snapshot 1`] = `
"lat": 40,
"lng": 60,
},
"open": true,
"price": Money {
"amount": 5500,
"currency": "USD",

View file

@ -106,21 +106,6 @@ export const image = shape({
// Denormalised listing object
export const listing = shape({
id: uuid.isRequired,
type: value('listing').isRequired,
attributes: shape({
title: string.isRequired,
description: string.isRequired,
address: string.isRequired,
geolocation: latlng.isRequired,
price: money,
}),
author: user,
images: arrayOf(image),
});
// Denormalised listing object
export const ownListing = shape({
id: uuid.isRequired,
type: value('listing').isRequired,
attributes: shape({
@ -131,6 +116,7 @@ export const ownListing = shape({
open: bool.isRequired,
price: money,
}),
author: user,
images: arrayOf(image),
});

View file

@ -70,6 +70,7 @@ export const createListing = (id, author = null, price = new Money(5500, 'USD'))
type: 'listing',
attributes: {
title: `${id} title`,
open: true,
price,
description: `${id} description`,
address: `${id} address`,