From c3002be4a696b7179d4419286ab9e1ca2ca8f224 Mon Sep 17 00:00:00 2001 From: Ben Wheeler Date: Thu, 4 Apr 2019 15:04:46 -0400 Subject: [PATCH] Revert "Merge pull request #2858 from benjiwheeler/studios-for-project-endpoint" This reverts commit a3902acfd12ba285c7071339ec143f4ef8eee079, reversing changes made to 9e7a14cb768ef3bc74510b79022cced84961611a. --- src/redux/preview.js | 5 ++--- src/views/preview/project-view.jsx | 9 ++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/redux/preview.js b/src/redux/preview.js index 4fbf21241..0a3eb2a5d 100644 --- a/src/redux/preview.js +++ b/src/redux/preview.js @@ -763,11 +763,10 @@ module.exports.getRemixes = id => (dispatch => { }); }); -module.exports.getProjectStudios = (id, ownerUsername, isAdmin, token) => (dispatch => { +module.exports.getProjectStudios = id => (dispatch => { dispatch(module.exports.setFetchStatus('projectStudios', module.exports.Status.FETCHING)); api({ - uri: `${isAdmin ? '/admin' : `/users/${ownerUsername}`}/projects/${id}/studios`, - authentication: token + uri: `/projects/${id}/studios` }, (err, body, res) => { if (err) { dispatch(module.exports.setFetchStatus('projectStudios', module.exports.Status.ERROR)); diff --git a/src/views/preview/project-view.jsx b/src/views/preview/project-view.jsx index 28a941c06..abcd8971e 100644 --- a/src/views/preview/project-view.jsx +++ b/src/views/preview/project-view.jsx @@ -159,10 +159,7 @@ class Preview extends React.Component { if (typeof this.props.projectInfo.id === 'undefined') { this.initCounts(0, 0); } else { - const token = this.props.user ? this.props.user.token : null; this.initCounts(this.props.projectInfo.stats.favorites, this.props.projectInfo.stats.loves); - this.props.getProjectStudios(this.props.projectInfo.id, - this.props.authorUsername, this.props.isAdmin, token); if (this.props.projectInfo.remix.parent !== null) { this.props.getParentInfo(this.props.projectInfo.remix.parent); } @@ -218,6 +215,7 @@ class Preview extends React.Component { } this.props.getProjectInfo(this.state.projectId, token); this.props.getRemixes(this.state.projectId, token); + this.props.getProjectStudios(this.state.projectId, token); this.props.getCuratedStudios(username); this.props.getFavedStatus(this.state.projectId, username, token); this.props.getLovedStatus(this.state.projectId, username, token); @@ -229,6 +227,7 @@ class Preview extends React.Component { } this.props.getProjectInfo(this.state.projectId); this.props.getRemixes(this.state.projectId); + this.props.getProjectStudios(this.state.projectId); } } setScreenFromOrientation () { @@ -981,8 +980,8 @@ const mapDispatchToProps = dispatch => ({ getRemixes: id => { dispatch(previewActions.getRemixes(id)); }, - getProjectStudios: (id, ownerUsername, isAdmin, token) => { - dispatch(previewActions.getProjectStudios(id, ownerUsername, isAdmin, token)); + getProjectStudios: id => { + dispatch(previewActions.getProjectStudios(id)); }, getCuratedStudios: (username, token) => { dispatch(previewActions.getCuratedStudios(username, token));