|
|
@ -37,8 +37,7 @@ export default class SettingsIndex {
|
|
|
|
REQUEST_TYPE_POST,
|
|
|
|
REQUEST_TYPE_POST,
|
|
|
|
CONTENT_TYPE_JSON,
|
|
|
|
CONTENT_TYPE_JSON,
|
|
|
|
data
|
|
|
|
data
|
|
|
|
).then(response => {
|
|
|
|
).then(r => {
|
|
|
|
let r = JSON.parse(response.request['response']);
|
|
|
|
|
|
|
|
if (r.type == DataEvent.SETTINGS_UPDATED) {
|
|
|
|
if (r.type == DataEvent.SETTINGS_UPDATED) {
|
|
|
|
notify.alert(r.message, true);
|
|
|
|
notify.alert(r.message, true);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -171,9 +170,7 @@ export default class SettingsIndex {
|
|
|
|
: imageData.append('background_upload', file, file.name);
|
|
|
|
: imageData.append('background_upload', file, file.name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
api.request(url, eventType, REQUEST_TYPE_POST, CONTENT_TYPE_FORM, imageData)
|
|
|
|
api.request(url, eventType, REQUEST_TYPE_POST, CONTENT_TYPE_FORM, imageData)
|
|
|
|
.then(response => {
|
|
|
|
.then(r => {
|
|
|
|
//TODO: Move JSON processing to API class
|
|
|
|
|
|
|
|
let r = JSON.parse(response.request['response']);
|
|
|
|
|
|
|
|
if (r.type == DataEvent.AVATAR_UPLOADED) {
|
|
|
|
if (r.type == DataEvent.AVATAR_UPLOADED) {
|
|
|
|
notify.alert(r.message, true);
|
|
|
|
notify.alert(r.message, true);
|
|
|
|
document.getElementById('avatar').src = r.url;
|
|
|
|
document.getElementById('avatar').src = r.url;
|
|
|
@ -197,8 +194,7 @@ export default class SettingsIndex {
|
|
|
|
CONTENT_TYPE_JSON,
|
|
|
|
CONTENT_TYPE_JSON,
|
|
|
|
task
|
|
|
|
task
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.then(response => {
|
|
|
|
.then(r => {
|
|
|
|
let r = JSON.parse(response.request['response']);
|
|
|
|
|
|
|
|
notify.alert(r.message, true);
|
|
|
|
notify.alert(r.message, true);
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.catch(err => {
|
|
|
|
.catch(err => {
|
|
|
|