|
|
@ -5,7 +5,6 @@ import Settings, { SETTINGS_FILE, SETTINGS_FOLKS } from '../../data/Settings';
|
|
|
|
import Navigation from '../../data/Navigation';
|
|
|
|
import Navigation from '../../data/Navigation';
|
|
|
|
import Book from '../../data/Book';
|
|
|
|
import Book from '../../data/Book';
|
|
|
|
import Utils from '../../data/Utils';
|
|
|
|
import Utils from '../../data/Utils';
|
|
|
|
import { util } from 'prettier';
|
|
|
|
|
|
|
|
const express = require('express');
|
|
|
|
const express = require('express');
|
|
|
|
const router = express.Router();
|
|
|
|
const router = express.Router();
|
|
|
|
const multer = require('multer');
|
|
|
|
const multer = require('multer');
|
|
|
@ -54,6 +53,7 @@ router.post('/sync', (req, res) => {
|
|
|
|
.catch(err => {
|
|
|
|
.catch(err => {
|
|
|
|
res.json({
|
|
|
|
res.json({
|
|
|
|
type: DataEvent.REQUEST_LAME,
|
|
|
|
type: DataEvent.REQUEST_LAME,
|
|
|
|
|
|
|
|
error: err.message,
|
|
|
|
message: "Uh oh. Settings didn't take, sport"
|
|
|
|
message: "Uh oh. Settings didn't take, sport"
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -238,23 +238,19 @@ router.post('/create-backup', (req, res) => {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
router.get('/download-backup', (req, res) => {
|
|
|
|
router.get('/download-backup', (req, res) => {
|
|
|
|
|
|
|
|
if (req.session.user) {
|
|
|
|
var filePath = 'content/backup.zip'; // Or format the path using the `id` rest param
|
|
|
|
var filePath = 'content/backup.zip'; // Or format the path using the `id` rest param
|
|
|
|
var fileName = 'backup.zip'; // The default name the browser will use
|
|
|
|
var fileName = 'backup.zip'; // The default name the browser will use
|
|
|
|
|
|
|
|
|
|
|
|
res.download(filePath, fileName);
|
|
|
|
res.download(filePath, fileName);
|
|
|
|
//Make secure
|
|
|
|
} else {
|
|
|
|
/*
|
|
|
|
|
|
|
|
auth.authCheck(req)
|
|
|
|
|
|
|
|
.then(() => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.catch(err => {
|
|
|
|
|
|
|
|
res.json({
|
|
|
|
res.json({
|
|
|
|
type: err.type,
|
|
|
|
type: DataEvent.REQUEST_LAME,
|
|
|
|
message: err.message
|
|
|
|
message: "You're not logged in, champ"
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Move to route?
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = router;
|
|
|
|
module.exports = router;
|
|
|
|