|
|
@ -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);
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|