diff --git a/src/routes.js b/src/routes.js index d2e3621b..aa6f34dd 100644 --- a/src/routes.js +++ b/src/routes.js @@ -1916,10 +1916,13 @@ module.exports = async ( * @param {{ body: UnfollowRequest }} req * @param {Response} res */ - const apiGunFollowsDelete = (req, res) => { + const apiGunFollowsDelete = (req, res) => { try { const user = require('../services/gunDB/Mediator').getUser() - const { body: { publicKey }} = req + /** + * @type {string} + */ + const publicKey = req.params.publickey user.get(Key.FOLLOWS).get(publicKey).put(null) @@ -1933,7 +1936,7 @@ module.exports = async ( ap.get('api/gun/follows', apiGunFollowsGet) ap.post(`/api/gun/follows`, apiGunFollowsPost) - ap.delete(`api/gun/follows`, apiGunFollowsDelete) + ap.delete(`api/gun/follows/:publickey`, apiGunFollowsDelete) /** * Return app so that it can be used by express.