re-enable follows
This commit is contained in:
parent
3c72432dce
commit
c106fd7410
1 changed files with 7 additions and 8 deletions
|
|
@ -1907,12 +1907,11 @@ module.exports = async (
|
||||||
/**
|
/**
|
||||||
* @type {RequestHandler<FollowsRouteParams>}
|
* @type {RequestHandler<FollowsRouteParams>}
|
||||||
*/
|
*/
|
||||||
const apiGunFollowsGet = (_, res) => {
|
const apiGunFollowsGet = async (_, res) => {
|
||||||
try {
|
try {
|
||||||
// const { publicKey } = req.params;
|
const currFollows = await GunGetters.Follows.currentFollows()
|
||||||
// const currFollows = await GunGetters.currentFollows()
|
|
||||||
|
|
||||||
return res.status(200).json({})
|
return res.status(200).json(currFollows)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return res.status(500).json({
|
return res.status(500).json({
|
||||||
errorMessage: err.message || 'Unknown ERR at GET /api/follows'
|
errorMessage: err.message || 'Unknown ERR at GET /api/follows'
|
||||||
|
|
@ -1924,14 +1923,14 @@ module.exports = async (
|
||||||
/**
|
/**
|
||||||
* @type {RequestHandler<FollowsRouteParams>}
|
* @type {RequestHandler<FollowsRouteParams>}
|
||||||
*/
|
*/
|
||||||
const apiGunFollowsPut = (req, res) => {
|
const apiGunFollowsPut = async (req, res) => {
|
||||||
try {
|
try {
|
||||||
const { publicKey } = req.params;
|
const { publicKey } = req.params;
|
||||||
if (!publicKey) {
|
if (!publicKey) {
|
||||||
throw new Error(`Missing publicKey route param.`)
|
throw new Error(`Missing publicKey route param.`)
|
||||||
}
|
}
|
||||||
|
|
||||||
// await GunActions.follow(req.params.publicKey, false)
|
await GunActions.follow(req.params.publicKey, false)
|
||||||
|
|
||||||
// 201 would be extraneous here. Implement it inside app.put
|
// 201 would be extraneous here. Implement it inside app.put
|
||||||
return res.status(200).json({
|
return res.status(200).json({
|
||||||
|
|
@ -1947,14 +1946,14 @@ module.exports = async (
|
||||||
/**
|
/**
|
||||||
* @type {RequestHandler<FollowsRouteParams>}
|
* @type {RequestHandler<FollowsRouteParams>}
|
||||||
*/
|
*/
|
||||||
const apiGunFollowsDelete = (req, res) => {
|
const apiGunFollowsDelete = async (req, res) => {
|
||||||
try {
|
try {
|
||||||
const { publicKey } = req.params;
|
const { publicKey } = req.params;
|
||||||
if (!publicKey) {
|
if (!publicKey) {
|
||||||
throw new Error(`Missing publicKey route param.`)
|
throw new Error(`Missing publicKey route param.`)
|
||||||
}
|
}
|
||||||
|
|
||||||
// await GunActions.unfollow(req.params.publicKey)
|
await GunActions.unfollow(req.params.publicKey)
|
||||||
|
|
||||||
return res.status(200).json({
|
return res.status(200).json({
|
||||||
ok: true
|
ok: true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue