Backend: Add force-unfollow action after ban

This commit is contained in:
Marco Realacci 2023-01-24 18:20:34 +01:00
parent 56d4c7410a
commit deb574396e

View file

@ -84,6 +84,13 @@ func (rt *_router) PutBan(w http.ResponseWriter, r *http.Request, ps httprouter.
return
}
// Removes the banning user to the banned user's followers (if present)
_, err = rt.db.UnfollowUser(banned, uid)
if err != nil {
helpers.SendInternalError(err, "Database error: UnfollowUser", w, rt.baseLogger)
}
helpers.SendStatus(http.StatusCreated, w, "Success", rt.baseLogger)
}