Skip to content

Commit

Permalink
do not send unnecessary fields to front (#262)
Browse files Browse the repository at this point in the history
hide phone numbers in calleraName
  • Loading branch information
BenoitSerrano authored Nov 22, 2023
1 parent 72e37ad commit 7aeb0e5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions controllers/dashboardController.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ module.exports.fetchDashboardInfo = async (req, res) => {
const participantIds = await conferences.fetchDashboardInfo(config.OVH_ROOM_PHONE_NUMBER, roomNumber)
const participants = await Promise.all(participantIds.map(id => conferences.getParticipant(config.OVH_ROOM_PHONE_NUMBER, roomNumber, id)))
return res.json({
participants: participants.map(participant => {
const arrivalDateTime = participant.arrivalDateTime
participants: participants.map(({callerNumber, arrivalDateTime, speak, talking}) => {
const date = new Date(arrivalDateTime)
return {
...participant,
speak,
talking,
arrivalTime: formatLocalTime(date),
callerNumber: participant.callerNumber.slice(0, 4) + "XXXX" + participant.callerNumber.slice(-4)
callerNumber: callerNumber.slice(0, 4) + "XXXX" + callerNumber.slice(-4)
}
}),
phoneNumber: formatFrenchPhoneNumber(config.OVH_ROOM_PHONE_NUMBER),
Expand Down

0 comments on commit 7aeb0e5

Please sign in to comment.