pass needed param

This commit is contained in:
Daniel Lugo 2020-02-21 16:39:13 -04:00
parent 74235a1a31
commit 380573e160

View file

@ -1565,6 +1565,7 @@ module.exports = async (
const GunEvent = require('../services/gunDB/event-constants') const GunEvent = require('../services/gunDB/event-constants')
const Events = require('../services/gunDB/contact-api/events') const Events = require('../services/gunDB/contact-api/events')
const user = require('../services/gunDB/Mediator').getUser()
app.get(`/api/gun/${GunEvent.ON_RECEIVED_REQUESTS}`, (_, res) => { app.get(`/api/gun/${GunEvent.ON_RECEIVED_REQUESTS}`, (_, res) => {
try { try {
@ -1614,7 +1615,7 @@ module.exports = async (
app.get(`/api/gun/${GunEvent.ON_AVATAR}`, (_, res) => { app.get(`/api/gun/${GunEvent.ON_AVATAR}`, (_, res) => {
try { try {
// spinup // spinup
Events.onAvatar(() => {})() Events.onAvatar(() => {}, user )()
const data = Events.getAvatar() const data = Events.getAvatar()
res.json({ res.json({
data data
@ -1629,7 +1630,7 @@ module.exports = async (
app.get(`/api/gun/${GunEvent.ON_DISPLAY_NAME}`, (_, res) => { app.get(`/api/gun/${GunEvent.ON_DISPLAY_NAME}`, (_, res) => {
try { try {
// spinup // spinup
Events.onDisplayName(() => {})() Events.onDisplayName(() => {}, user)()
const data = Events.getDisplayName() const data = Events.getDisplayName()
res.json({ res.json({
data data
@ -1644,7 +1645,7 @@ module.exports = async (
app.get(`/api/gun/${GunEvent.ON_HANDSHAKE_ADDRESS}`, (_, res) => { app.get(`/api/gun/${GunEvent.ON_HANDSHAKE_ADDRESS}`, (_, res) => {
try { try {
// spinup // spinup
Events.onCurrentHandshakeAddress(() => {})() Events.onCurrentHandshakeAddress(() => {}, user)()
const data = Events.getHandshakeAddress() const data = Events.getHandshakeAddress()
res.json({ res.json({
data data