This commit is contained in:
@@ -373,6 +373,15 @@ export default {
|
||||
return this.APIUrl(url);
|
||||
},
|
||||
/////////////////////////////
|
||||
// logo download URL
|
||||
// (size= 'small', 'medium', 'large')
|
||||
logoUrl(size) {
|
||||
//http://localhost:7575/api/v8/logo/small
|
||||
|
||||
let url = "logo/" + size;
|
||||
return this.APIUrl(url);
|
||||
},
|
||||
/////////////////////////////
|
||||
// REPLACE END OF URL
|
||||
// (used to change ID in url)
|
||||
replaceAfterLastSlash(theUrl, theReplacement) {
|
||||
@@ -573,6 +582,36 @@ export default {
|
||||
} catch (error) {
|
||||
handleError("POSTATTACHMENT", error, route);
|
||||
}
|
||||
},
|
||||
|
||||
///////////////////////////////////
|
||||
// POST LOGO
|
||||
//
|
||||
//
|
||||
async uploadLogo(fileData, size) {
|
||||
let that = this;
|
||||
try {
|
||||
var data = new FormData();
|
||||
data.append(fileData.name, fileData);
|
||||
|
||||
//-----------------
|
||||
|
||||
let fetchOptions = {
|
||||
method: "post",
|
||||
mode: "cors",
|
||||
headers: {
|
||||
Authorization: "Bearer " + window.$gz.store.state.apiToken
|
||||
},
|
||||
body: data
|
||||
};
|
||||
|
||||
let r = await fetch(that.APIUrl("logo/" + size), fetchOptions);
|
||||
that.statusEx(r);
|
||||
r = await that.extractBodyEx(r);
|
||||
return r;
|
||||
} catch (error) {
|
||||
handleError("uploadLogo", error, route);
|
||||
}
|
||||
}
|
||||
//---------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user