(Bugfix undefined id) Use file sha as id

This commit is contained in:
Luís Miguel 2018-03-23 15:21:07 +00:00 committed by Shawn Erquhart
parent cc60dc9aa9
commit 8e2fefc3f7

View File

@ -138,7 +138,7 @@ export default class GitHub {
const repo = this.repo || this.getRepoFromResponseUrl(response.url);
const { value, size, path, fileObj } = mediaFile;
const url = `https://raw.githubusercontent.com/${repo}/${this.branch}${path}`;
return { id: response.sha, name: value, size: fileObj.size, url, path: trimStart(path, '/') };
return { id: mediaFile.sha, name: value, size: fileObj.size, url, path: trimStart(path, '/') };
}
catch(error) {
console.error(error);