add minimum length for content
This commit is contained in:
parent
d4d7e6c8c2
commit
9d43ab9903
|
@ -13,6 +13,12 @@ async function upload(req, res) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = req.body.text;
|
const data = req.body.text;
|
||||||
|
|
||||||
|
if (data.length < 8) {
|
||||||
|
res.send('Too short');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const id = await content.create(data);
|
const id = await content.create(data);
|
||||||
res.redirect(
|
res.redirect(
|
||||||
'/view?id=' + encodeURIComponent(id)
|
'/view?id=' + encodeURIComponent(id)
|
||||||
|
|
Loading…
Reference in New Issue