use route params for follows delete
This commit is contained in:
parent
424f199b4e
commit
11c5337e0f
1 changed files with 6 additions and 3 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue