Asset API (#204)

Asset API
This commit is contained in:
Cássio Souza
2017-01-10 22:23:22 -02:00
committed by GitHub
parent 37f690fc44
commit a4d7622ade
52 changed files with 706 additions and 687 deletions

View File

@ -1,7 +1,7 @@
import LocalForage from "localforage";
import { Base64 } from "js-base64";
import _ from "lodash";
import MediaProxy from "../../valueObjects/MediaProxy";
import AssetProxy from "../../valueObjects/AssetProxy";
import { SIMPLE, EDITORIAL_WORKFLOW, status } from "../../constants/publishModes";
export default class API {
@ -356,7 +356,7 @@ export default class API {
}
uploadBlob(item) {
const content = item instanceof MediaProxy ? item.toBase64() : this.toBase64(item.raw);
const content = item instanceof AssetProxy ? item.toBase64() : this.toBase64(item.raw);
return content.then(contentBase64 => this.request(`${ this.repoURL }/git/blobs`, {
method: "POST",