1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-07-30 10:39:43 +02:00

🤩MongoDB support 🤩 (#272)

* implement configuration through YAML

* remove rcparser

* use password from appConfig

* update docker configs

* fix dockerignore

* implement mongodb driver

* update eslint packages

* fix bugs

* refactor code for grouping by parent

* fix yet another bug

* use unique symbol to the EntityId type

* fix more bugs

* implement db converter

* fix bug with parent selector

* fix eslint

* db-converter refactoring

* create cli program for db-converter

* add readme and gitignore

* update development docs

* update development docs and default config

* add docs about converter

* add src/test to docker ignore

* move database code from utils

* improve docs

* eslint fix

* add more docs

* fix docs

* remove env_file from docker-compose

* implement duplicate detection in db-converter

* use published version of the config-loader

* fix bug

* Update DEVELOPMENT.md

Co-authored-by: Ilya Maroz <37909603+ilyamore88@users.noreply.github.com>

* fix bugs

* fix next/prev buttons

* fix more bugs

* fix sorting

Co-authored-by: Ilya Maroz <37909603+ilyamore88@users.noreply.github.com>
This commit is contained in:
Nikita Melnikov 2022-10-03 16:23:59 +04:00 committed by GitHub
parent 13762096c4
commit 55b4b3ee61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
72 changed files with 12614 additions and 665 deletions

View file

@ -4,6 +4,7 @@ import PagesOrder from '../controllers/pagesOrder.js';
import verifyToken from './middlewares/token.js';
import allowEdit from './middlewares/locals.js';
import PagesFlatArray from '../models/pagesFlatArray.js';
import { toEntityId } from '../database/index.js';
const router = express.Router();
@ -14,6 +15,8 @@ router.get('/page/new', verifyToken, allowEdit, async (req: Request, res: Respon
try {
const pagesAvailableGrouped = await Pages.groupByParent();
console.log(pagesAvailableGrouped);
res.render('pages/form', {
pagesAvailableGrouped,
page: null,
@ -28,7 +31,7 @@ router.get('/page/new', verifyToken, allowEdit, async (req: Request, res: Respon
* Edit page form
*/
router.get('/page/edit/:id', verifyToken, allowEdit, async (req: Request, res: Response, next: NextFunction) => {
const pageId = req.params.id;
const pageId = toEntityId(req.params.id);
try {
const page = await Pages.get(pageId);
@ -56,7 +59,7 @@ router.get('/page/edit/:id', verifyToken, allowEdit, async (req: Request, res: R
* View page
*/
router.get('/page/:id', verifyToken, async (req: Request, res: Response, next: NextFunction) => {
const pageId = req.params.id;
const pageId = toEntityId(req.params.id);
try {
const page = await Pages.get(pageId);