found and fixed navigation order updating bug. whew.
This commit is contained in:
parent
9dd8be25f4
commit
35a20479fe
2 changed files with 21 additions and 11 deletions
|
@ -14,9 +14,12 @@ export default class Navigation {
|
||||||
//--------------------------
|
//--------------------------
|
||||||
sync(body) {
|
sync(body) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
let response = [];
|
||||||
|
settings
|
||||||
|
.load(SETTINGS_FILE)
|
||||||
|
.then(settings => {
|
||||||
let payload = body;
|
let payload = body;
|
||||||
settings.menu = payload;
|
settings.menu = payload;
|
||||||
let response = [];
|
|
||||||
fs.writeJson('site/settings.json', settings)
|
fs.writeJson('site/settings.json', settings)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
response = {
|
response = {
|
||||||
|
@ -32,6 +35,14 @@ export default class Navigation {
|
||||||
};
|
};
|
||||||
reject(response);
|
reject(response);
|
||||||
});
|
});
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
response = {
|
||||||
|
type: DataEvent.REQUEST_LAME,
|
||||||
|
message: err
|
||||||
|
};
|
||||||
|
reject(response);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,7 @@ export default class NavIndex {
|
||||||
REQUEST_TYPE_POST,
|
REQUEST_TYPE_POST,
|
||||||
CONTENT_TYPE_JSON,
|
CONTENT_TYPE_JSON,
|
||||||
data
|
data
|
||||||
).then(response => {
|
).then(r => {
|
||||||
let r = response.response;
|
|
||||||
if (r.type == DataEvent.MENU_UPDATED) {
|
if (r.type == DataEvent.MENU_UPDATED) {
|
||||||
notify.alert(r.message, true);
|
notify.alert(r.message, true);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue