validate posts must contain at least one paragraph/image/video

This commit is contained in:
Daniel Lugo 2020-06-24 12:58:00 +01:00
parent eecfe34156
commit ed3e343e0e

View file

@ -1255,6 +1255,10 @@ const setLastSeenApp = () =>
* @returns {Promise<Common.Schema.Post>}
*/
const createPost = async (tags, title, content) => {
if (content.length === 0) {
throw new Error(`A post must contain at least one paragraph/image/video`)
}
const user = require('../Mediator').getUser()
const wall = user.get(Key.WALL)
const pages = wall.get(Key.PAGES)