Fix update to tags API

Signed-off-by: Jeffrey Morgan <jmorganca@gmail.com>
This commit is contained in:
Jeffrey Morgan 2015-07-18 10:56:59 -04:00
parent ae7535723d
commit 56c39c9c7f
1 changed files with 4 additions and 4 deletions

View File

@ -103,11 +103,11 @@ module.exports = {
}, (error, response, body) => {
if (response.statusCode === 200) {
let data = JSON.parse(body);
tagServerActions.tagsUpdated({repo, tags: data});
if (callback) { callback(null, data); }
} else if (error || response.statusCode === 401) {
tagServerActions.tagsUpdated({repo, tags: data.results || []});
if (callback) { callback(null, data.results || []); }
} else {
repositoryServerActions.error({repo});
if (callback) { callback(new Error('Failed to fetch repos')); }
if (callback) { callback(new Error('Failed to fetch tags for repo')); }
}
});
},