Browse Source

add do-not-post checker in tags

master
Rich Brown 1 year ago
parent
commit
ec318bc3b5
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      routes/createRouter.js

+ 4
- 1
routes/createRouter.js View File

@@ -13,7 +13,10 @@ createRouter.post('/', (req, res) => {
if (!tags || tags === []) {
tags = ['micro.blog'];
}

// sort of a jokey thing here
if (tags.includes('do not post')) {
return res.status(422).json({ error: 'Unprocessed. -do not post- found in tags', url: null });
}
if (title === '') {
return req.app.locals.mp
.create({ h: 'entry', content: text, category: tags }, 'form') // TODO: test categories/tags


Loading…
Cancel
Save