make token optional in call to getProjectStudios endpoint

This commit is contained in:
Ben Wheeler 2019-03-22 15:43:00 -04:00
parent 4a20a09f52
commit 986c608136

View file

@ -765,10 +765,13 @@ module.exports.getRemixes = id => (dispatch => {
module.exports.getProjectStudios = (id, username, token) => (dispatch => {
dispatch(module.exports.setFetchStatus('projectStudios', module.exports.Status.FETCHING));
api({
uri: `/users/${username}/projects/${id}/studios`,
authentication: token
}, (err, body, res) => {
const apiOpts = {
uri: `/users/${username}/projects/${id}/studios`
};
if (token) {
apiOpts.authentication = token;
}
api(apiOpts, (err, body, res) => {
if (err) {
dispatch(module.exports.setFetchStatus('projectStudios', module.exports.Status.ERROR));
dispatch(module.exports.setError(err));