mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
make token optional in call to getProjectStudios endpoint
This commit is contained in:
parent
4a20a09f52
commit
986c608136
1 changed files with 7 additions and 4 deletions
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue