Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 739311928f | |||
| 78cda0fe50 | |||
| 7d40005e7d | |||
| 855de182ea | |||
| a96e7d9344 |
@@ -48,6 +48,7 @@ GET /news/archive/:id
|
||||
"title": title, //title of the article
|
||||
"author": author, //author of the aricle
|
||||
"body": body, //body of the article
|
||||
"rendered": rendered //body rendered as HTML
|
||||
"edits": edits //number of times this article has been edited
|
||||
"createdAt": createdAt //time created
|
||||
"updatedAt": updatedAt //time updated
|
||||
|
||||
Generated
+8
-8
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "news-server",
|
||||
"version": "1.4.0",
|
||||
"version": "1.4.3",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "news-server",
|
||||
"version": "1.4.0",
|
||||
"version": "1.4.3",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"cors": "^2.8.5",
|
||||
@@ -1172,9 +1172,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/markdown-it": {
|
||||
"version": "12.3.0",
|
||||
"resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.0.tgz",
|
||||
"integrity": "sha512-T345UZZ6ejQWTjG6PSEHplzNy5m4kF6zvUpHVDv8Snl/pEU0OxIK0jGg8YLVNwJvT8E0YJC7/2UvssJDk/wQCQ==",
|
||||
"version": "12.3.2",
|
||||
"resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz",
|
||||
"integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==",
|
||||
"dependencies": {
|
||||
"argparse": "^2.0.1",
|
||||
"entities": "~2.1.0",
|
||||
@@ -3025,9 +3025,9 @@
|
||||
}
|
||||
},
|
||||
"markdown-it": {
|
||||
"version": "12.3.0",
|
||||
"resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.0.tgz",
|
||||
"integrity": "sha512-T345UZZ6ejQWTjG6PSEHplzNy5m4kF6zvUpHVDv8Snl/pEU0OxIK0jGg8YLVNwJvT8E0YJC7/2UvssJDk/wQCQ==",
|
||||
"version": "12.3.2",
|
||||
"resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz",
|
||||
"integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==",
|
||||
"requires": {
|
||||
"argparse": "^2.0.1",
|
||||
"entities": "~2.1.0",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "news-server",
|
||||
"version": "1.4.0",
|
||||
"version": "1.4.3",
|
||||
"description": "An API centric news server. Uses Sequelize and mariaDB by default.",
|
||||
"main": "server/server.js",
|
||||
"scripts": {
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
const { Op } = require('sequelize');
|
||||
const { articles, revisions } = require('../database/models');
|
||||
const markdownIt = require('markdown-it')();
|
||||
const markdownIt = require('markdown-it')({ html: true });
|
||||
|
||||
const route = async (req, res) => {
|
||||
//get the existing record
|
||||
|
||||
@@ -23,7 +23,7 @@ router.get('/archive/metadata/:id(\\d+)', query(true, true));
|
||||
//use middleware to authenticate the rest of the routes
|
||||
router.use(authToken);
|
||||
router.use((req, res, next) => {
|
||||
if (req.user.admin) {
|
||||
if (req.user.mod) {
|
||||
next();
|
||||
} else {
|
||||
res.status(403).end();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const { articles } = require('../database/models');
|
||||
const markdownIt = require('markdown-it')();
|
||||
const markdownIt = require('markdown-it')({ html: true });
|
||||
|
||||
const route = async (req, res) => {
|
||||
//check for missing data
|
||||
|
||||
Reference in New Issue
Block a user