박권수

Merge branch 'server' into web

...@@ -106,11 +106,25 @@ exports.viewAllDoctorRegisterReq = async ctx => { ...@@ -106,11 +106,25 @@ exports.viewAllDoctorRegisterReq = async ctx => {
106 return; 106 return;
107 } 107 }
108 108
109 - const patientInfoList = await PatientInfo.findAllByPatientIdAndUseYn(userId, 'W'); 109 + const patientInfoList = await PatientInfo.find({
110 + patientId : userId,
111 + useYn : 'W',
112 + })
113 +
114 + const doctorReqList = await Promise.all(patientInfoList.map(async patientInfo => {
115 + const doctor = await DoctorInfo.findOne({ doctorId : patientInfo.doctorId });
116 + return {
117 + patientId : patientInfo.patientId,
118 + doctorId : patientInfo.doctorId,
119 + useYn : patientInfo.useYn,
120 + info : patientInfo.info,
121 + doctorNm : doctor.info.doctorNm,
122 + }
123 + }));
110 124
111 ctx.status = 200; 125 ctx.status = 200;
112 ctx.body = { 126 ctx.body = {
113 - patientInfoList, 127 + doctorReqList,
114 }; 128 };
115 129
116 }; 130 };
......