mirror of
https://github.com/xfarrow/blink
synced 2025-06-06 00:49:11 +02:00
Get contactinfos also when retrieving a person
This commit is contained in:
parent
836fc822a9
commit
f44eaea363
@ -16,6 +16,7 @@ const jwtUtils = require('../utils/jwt_utils');
|
|||||||
const bcrypt = require('bcrypt');
|
const bcrypt = require('bcrypt');
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
const Person = require('../models/person_model');
|
const Person = require('../models/person_model');
|
||||||
|
const PersonContactInfo = require('../models/person_contact_info_model');
|
||||||
const Activation = require('../models/activation_model');
|
const Activation = require('../models/activation_model');
|
||||||
const express = require('express');
|
const express = require('express');
|
||||||
const mailUtils = require('../utils/mail_utils');
|
const mailUtils = require('../utils/mail_utils');
|
||||||
@ -145,6 +146,8 @@ async function getPerson(req, res) {
|
|||||||
const person = await Person.findById(req.params.id);
|
const person = await Person.findById(req.params.id);
|
||||||
if (person && person.enabled) {
|
if (person && person.enabled) {
|
||||||
delete person.password; // remove password field for security reasons
|
delete person.password; // remove password field for security reasons
|
||||||
|
const contactInfos = await PersonContactInfo.getInfoByPerson(person.id);
|
||||||
|
person.contact_infos = contactInfos;
|
||||||
return res.status(200).send(person);
|
return res.status(200).send(person);
|
||||||
}
|
}
|
||||||
return res.status(404).json({
|
return res.status(404).json({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user