Merge branch 'refactor/object_required_#23'

Fixes #23
This commit is contained in:
cleverbeagle 2017-07-31 09:39:56 -05:00
commit 38fd490b21
2 changed files with 7 additions and 3 deletions

View file

@ -13,8 +13,12 @@ const EditDocument = ({ doc, history }) => (doc ? (
</div> </div>
) : <NotFound />); ) : <NotFound />);
EditDocument.defaultProps = {
doc: null,
};
EditDocument.propTypes = { EditDocument.propTypes = {
doc: PropTypes.object.isRequired, doc: PropTypes.object,
history: PropTypes.object.isRequired, history: PropTypes.object.isRequired,
}; };

View file

@ -44,7 +44,7 @@ const ViewDocument = ({ loading, doc, match, history }) => (
ViewDocument.propTypes = { ViewDocument.propTypes = {
loading: PropTypes.bool.isRequired, loading: PropTypes.bool.isRequired,
doc: PropTypes.object.isRequired, doc: PropTypes.object,
match: PropTypes.object.isRequired, match: PropTypes.object.isRequired,
history: PropTypes.object.isRequired, history: PropTypes.object.isRequired,
}; };
@ -55,6 +55,6 @@ export default createContainer(({ match }) => {
return { return {
loading: !subscription.ready(), loading: !subscription.ready(),
doc: Documents.findOne(documentId) || {}, doc: Documents.findOne(documentId),
}; };
}, ViewDocument); }, ViewDocument);