This commit is contained in:
Daniel Lugo 2020-06-24 17:40:09 -04:00
parent b7abbb2535
commit 1b6fe78947
2 changed files with 19 additions and 0 deletions

View file

@ -1295,6 +1295,22 @@ const createPost = async (tags, title, content) => {
pageIdx = Number(pageIdx + 1).toString()
}
await new Promise(res => {
require('../Mediator')
.getUser()
.get(Key.WALL)
.get(Key.PAGES)
.get(pageIdx)
.get(Key.COUNT)
.put(count + 1, ack => {
if (ack.err) {
throw new Error(ack.err)
}
res()
})
})
/** @type {string} */
const postID = await new Promise((res, rej) => {
const _n = require('../Mediator')
@ -1302,6 +1318,7 @@ const createPost = async (tags, title, content) => {
.get(Key.WALL)
.get(Key.PAGES)
.get(pageIdx)
.get(Key.POSTS)
.set(
{
date: Date.now(),

View file

@ -53,3 +53,5 @@ exports.COUNT = 'count'
exports.CONTENT_ITEMS = 'contentItems'
exports.FOLLOWS = 'follows'
exports.POSTS = 'posts'