javascriptier exports
This commit is contained in:
parent
fb9b71781e
commit
c438d3293f
3 changed files with 9 additions and 5 deletions
|
|
@ -6,6 +6,8 @@ const Common = require('shock-common')
|
|||
const Key = require('../key')
|
||||
const Utils = require('../utils')
|
||||
|
||||
const Wall = require('./wall')
|
||||
|
||||
/**
|
||||
* @param {string} pub
|
||||
* @returns {Promise<string>}
|
||||
|
|
@ -89,4 +91,6 @@ const getMyUser = async () => {
|
|||
|
||||
module.exports.getMyUser = getMyUser
|
||||
module.exports.Follows = require('./follows')
|
||||
module.exports.Wall = require('./wall')
|
||||
|
||||
module.exports.getWallPage = Wall.getWallPage
|
||||
module.exports.getWallTotalPages = Wall.getWallTotalPages
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ const Key = require('../key')
|
|||
/**
|
||||
* @returns {Promise<number>}
|
||||
*/
|
||||
const getTotalPages = () =>
|
||||
const getWallTotalPages = () =>
|
||||
/** @type {Promise<number>} */ (Utils.tryAndWait(
|
||||
(_, user) =>
|
||||
user
|
||||
|
|
@ -24,7 +24,7 @@ const getTotalPages = () =>
|
|||
* @returns {Promise<Common.SchemaTypes.WallPage>}
|
||||
*/
|
||||
const getWallPage = async page => {
|
||||
const totalPages = await getTotalPages()
|
||||
const totalPages = await getWallTotalPages()
|
||||
const empty = {
|
||||
count: 0,
|
||||
posts: {}
|
||||
|
|
@ -55,6 +55,6 @@ const getWallPage = async page => {
|
|||
}
|
||||
|
||||
module.exports = {
|
||||
getTotalPages,
|
||||
getWallTotalPages,
|
||||
getWallPage
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1845,7 +1845,7 @@ module.exports = async (
|
|||
try {
|
||||
const { page } = req.query;
|
||||
|
||||
return res.status(200).json(await GunGetters.Wall.getWallPage(page))
|
||||
return res.status(200).json(await GunGetters.getWallPage(page))
|
||||
} catch (err) {
|
||||
return res.status(500).json({
|
||||
errorMessage: err.message
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue