|
|
|
@ -14,16 +14,27 @@ export default class Navigation {
|
|
|
|
|
//--------------------------
|
|
|
|
|
sync(body) {
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
let payload = body;
|
|
|
|
|
settings.menu = payload;
|
|
|
|
|
let response = [];
|
|
|
|
|
fs.writeJson('site/settings.json', settings)
|
|
|
|
|
.then(() => {
|
|
|
|
|
response = {
|
|
|
|
|
type: DataEvent.SETTINGS_UPDATED,
|
|
|
|
|
message: 'Menu order saved, champ'
|
|
|
|
|
};
|
|
|
|
|
resolve(response);
|
|
|
|
|
settings
|
|
|
|
|
.load(SETTINGS_FILE)
|
|
|
|
|
.then(settings => {
|
|
|
|
|
let payload = body;
|
|
|
|
|
settings.menu = payload;
|
|
|
|
|
fs.writeJson('site/settings.json', settings)
|
|
|
|
|
.then(() => {
|
|
|
|
|
response = {
|
|
|
|
|
type: DataEvent.SETTINGS_UPDATED,
|
|
|
|
|
message: 'Menu order saved, champ'
|
|
|
|
|
};
|
|
|
|
|
resolve(response);
|
|
|
|
|
})
|
|
|
|
|
.catch(err => {
|
|
|
|
|
response = {
|
|
|
|
|
type: DataEvent.REQUEST_LAME,
|
|
|
|
|
message: err
|
|
|
|
|
};
|
|
|
|
|
reject(response);
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.catch(err => {
|
|
|
|
|
response = {
|
|
|
|
|