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