diff --git a/client/coral-embed-stream/src/CommentStream.js b/client/coral-embed-stream/src/CommentStream.js
index 1922d3c3d..d46042df8 100644
--- a/client/coral-embed-stream/src/CommentStream.js
+++ b/client/coral-embed-stream/src/CommentStream.js
@@ -53,7 +53,7 @@ class CommentStream extends Component {
}
toggleStatus () {
- this.props.updateStatus(this.props.config.status === 'open' ? 'closed' : 'open')
+ this.props.updateStatus(this.props.config.status === 'open' ? 'closed' : 'open');
}
static propTypes = {
@@ -105,154 +105,153 @@ class CommentStream extends Component {
{/* Add to the restricted param a boolean if the user is suspended*/}
}>
- {
- status === 'open'
- ?
- : Comments are closed for this thread.
- }
- {
- rootItem.comments && rootItem.comments.map((commentId) => {
- const comment = comments[commentId];
- return ;
+ })
+ }
+ ;
+ })
+ }
+
+
+
+
+
+
+ {status === 'open' ? 'Close' : 'Open'} Comment Stream
+
+
+
+
:
-
+
}
;
}
}
-const CloseCommentsInfo = ({ status, onClick }) => status === 'open' ? (
+const CloseCommentsInfo = ({status, onClick}) => status === 'open' ? (
This comment stream is currently open. By closing this comment stream,
@@ -284,7 +283,7 @@ const CloseCommentsInfo = ({ status, onClick }) => status === 'open' ? (
Open Stream
-)
+);
const mapStateToProps = state => ({
config: state.config.toJS(),
diff --git a/client/coral-framework/actions/config.js b/client/coral-framework/actions/config.js
index 09b4596a7..6dc880434 100644
--- a/client/coral-framework/actions/config.js
+++ b/client/coral-framework/actions/config.js
@@ -10,9 +10,9 @@ export const CLOSE_COMMENTS = 'CLOSE_COMMENTS';
export const ADD_ITEM = 'ADD_ITEM';
export const updateOpenStatus = status => (dispatch, getState) => {
- const assetId = getState().items.get('assets').keySeq().toArray()[0]
+ const assetId = getState().items.get('assets')
+ .keySeq()
+ .toArray()[0];
return coralApi(`/asset/${assetId}/status?status=${status}`, {method: 'PUT'})
- .then(res => {
- dispatch({ type: status === 'open' ? OPEN_COMMENTS : CLOSE_COMMENTS })
- })
-}
+ .then(() => dispatch({type: status === 'open' ? OPEN_COMMENTS : CLOSE_COMMENTS}));
+};
diff --git a/routes/api/asset/index.js b/routes/api/asset/index.js
index 30cb98528..05926bc15 100644
--- a/routes/api/asset/index.js
+++ b/routes/api/asset/index.js
@@ -99,13 +99,9 @@ router.put('/:asset_id/settings', (req, res, next) => {
router.put('/:asset_id/status', (req, res, next) => {
// Update the asset status
Asset
- .update({ id: req.params.asset_id }, { status: req.query.status })
- .then((asset) => {
- res.status(204).end();
- })
- .catch((err) => {
- next(err);
- });
+ .update({id: req.params.asset_id}, {status: req.query.status})
+ .then(() => res.status(204).end())
+ .catch((err) => next(err));
});
module.exports = router;