mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-08-07 22:45:23 +02:00
Update code style
This commit is contained in:
parent
ed3a784518
commit
2c5069c3d8
18 changed files with 59 additions and 60 deletions
|
@ -1,6 +1,6 @@
|
|||
import hljs from 'highlight.js/lib/highlight';
|
||||
import javascript from 'highlight.js/lib/languages/javascript';
|
||||
import style from 'highlight.js/styles/github-gist.css';
|
||||
import style from 'highlight.js/styles/github-gist.css'; //eslint-disable-line no-unused-vars
|
||||
|
||||
/**
|
||||
* @class CodeStyles
|
||||
|
|
|
@ -64,7 +64,7 @@ export default class Writing {
|
|||
|
||||
if (this.nodes.removeButton) {
|
||||
this.nodes.removeButton.addEventListener('click', () => {
|
||||
const isUserAgree = confirm('Are you sure?');
|
||||
const isUserAgree = window.confirm('Are you sure?');
|
||||
|
||||
if (!isUserAgree) {
|
||||
return;
|
||||
|
|
|
@ -3,13 +3,12 @@ const router = express.Router();
|
|||
const multer = require('multer')();
|
||||
const Pages = require('../../controllers/pages');
|
||||
const PagesOrder = require('../../controllers/pagesOrder');
|
||||
const Aliases = require('../../controllers/aliases');
|
||||
|
||||
/**
|
||||
* GET /page/:id
|
||||
*
|
||||
* Return PageData of page with given id
|
||||
*/
|
||||
|
||||
router.get('/page/:id', async (req, res) => {
|
||||
try {
|
||||
const page = await Pages.get(req.params.id);
|
||||
|
@ -134,7 +133,7 @@ router.delete('/page/:id', async (req, res) => {
|
|||
* @param startFrom
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async function deleteRecursively(startFrom) {
|
||||
const deleteRecursively = async (startFrom) => {
|
||||
let order = [];
|
||||
|
||||
try {
|
||||
|
@ -151,7 +150,7 @@ router.delete('/page/:id', async (req, res) => {
|
|||
try {
|
||||
await PagesOrder.remove(startFrom);
|
||||
} catch (e) {}
|
||||
}
|
||||
};
|
||||
|
||||
await deleteRecursively(req.params.id);
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ const asyncMiddleware = require('../../utils/asyncMiddleware');
|
|||
* @return {Page[]}
|
||||
*/
|
||||
async function createMenuTree(pages, level = 1, currentLevel = 1) {
|
||||
return await Promise.all(pages.map(async pageId => {
|
||||
return Promise.all(pages.map(async pageId => {
|
||||
const parent = await Pages.get(pageId);
|
||||
|
||||
/**
|
||||
|
@ -51,7 +51,7 @@ async function createMenuTree(pages, level = 1, currentLevel = 1) {
|
|||
* @param res
|
||||
* @param next
|
||||
*/
|
||||
module.exports = asyncMiddleware(async function (req, res, next) {
|
||||
module.exports = asyncMiddleware(async (req, res, next) => {
|
||||
/**
|
||||
* Pages without parent
|
||||
* @type {string}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue