validate posts must contain at least one paragraph/image/video
This commit is contained in:
parent
eecfe34156
commit
ed3e343e0e
1 changed files with 4 additions and 0 deletions
|
|
@ -1255,6 +1255,10 @@ const setLastSeenApp = () =>
|
||||||
* @returns {Promise<Common.Schema.Post>}
|
* @returns {Promise<Common.Schema.Post>}
|
||||||
*/
|
*/
|
||||||
const createPost = async (tags, title, content) => {
|
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 user = require('../Mediator').getUser()
|
||||||
const wall = user.get(Key.WALL)
|
const wall = user.get(Key.WALL)
|
||||||
const pages = wall.get(Key.PAGES)
|
const pages = wall.get(Key.PAGES)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue