박권수

fix. catch error

...@@ -200,8 +200,8 @@ exports.doctorRegister = async ctx => { ...@@ -200,8 +200,8 @@ exports.doctorRegister = async ctx => {
200 useYn : 'W', 200 useYn : 'W',
201 }); 201 });
202 202
203 - await doctor.save();
204 await doctorInfo.save(); 203 await doctorInfo.save();
204 + await doctor.save();
205 205
206 ctx.status = 201; 206 ctx.status = 201;
207 207
......
...@@ -17,12 +17,14 @@ exports.uploadDoctorLicense = async ({ userId, fileName, filePath }) => { ...@@ -17,12 +17,14 @@ exports.uploadDoctorLicense = async ({ userId, fileName, filePath }) => {
17 17
18 return doctorLicenseUrl; 18 return doctorLicenseUrl;
19 } catch(e) { 19 } catch(e) {
20 + console.log(e);
20 return null; 21 return null;
21 } 22 }
22 }; 23 };
23 24
24 //의사 정보를 인자로 받아 해당 Doctor License의 Signed URL을 반환 25 //의사 정보를 인자로 받아 해당 Doctor License의 Signed URL을 반환
25 exports.viewDoctorLicense = async ({ doctorInfo }) => { 26 exports.viewDoctorLicense = async ({ doctorInfo }) => {
27 + try {
26 const fileName = doctorInfo.info.doctorLicense.split('/').pop(); 28 const fileName = doctorInfo.info.doctorLicense.split('/').pop();
27 const file = storage.bucket('doctor-info').file(fileName); 29 const file = storage.bucket('doctor-info').file(fileName);
28 const option = { 30 const option = {
...@@ -34,6 +36,10 @@ exports.viewDoctorLicense = async ({ doctorInfo }) => { ...@@ -34,6 +36,10 @@ exports.viewDoctorLicense = async ({ doctorInfo }) => {
34 const [signedUrl] = file ? await file.getSignedUrl(option) : [null]; 36 const [signedUrl] = file ? await file.getSignedUrl(option) : [null];
35 37
36 return signedUrl; 38 return signedUrl;
39 + } catch(e) {
40 + console.log(e);
41 + return null;
42 + }
37 }; 43 };
38 44
39 //의사 ID, 약 ID, 복용량을 인자로 받아, QR Code를 생성 45 //의사 ID, 약 ID, 복용량을 인자로 받아, QR Code를 생성
...@@ -59,6 +65,7 @@ exports.uploadQrCode = async ({ directory, qrCodeFileName }) => { ...@@ -59,6 +65,7 @@ exports.uploadQrCode = async ({ directory, qrCodeFileName }) => {
59 65
60 //생성된 QR코드의 signedUrl을 가져옴 66 //생성된 QR코드의 signedUrl을 가져옴
61 exports.getQrCodeUrl = async ({ qrCodeFileName }) => { 67 exports.getQrCodeUrl = async ({ qrCodeFileName }) => {
68 + try {
62 const fileName = qrCodeFileName; 69 const fileName = qrCodeFileName;
63 const file = storage.bucket('prescribe-medicine-qrcode').file(fileName); 70 const file = storage.bucket('prescribe-medicine-qrcode').file(fileName);
64 const option = { 71 const option = {
...@@ -70,4 +77,8 @@ exports.getQrCodeUrl = async ({ qrCodeFileName }) => { ...@@ -70,4 +77,8 @@ exports.getQrCodeUrl = async ({ qrCodeFileName }) => {
70 const [signedUrl] = file ? await file.getSignedUrl(option) : [null]; 77 const [signedUrl] = file ? await file.getSignedUrl(option) : [null];
71 78
72 return signedUrl; 79 return signedUrl;
80 + } catch(e) {
81 + console.log(e);
82 + return null;
83 + }
73 }; 84 };
...\ No newline at end of file ...\ No newline at end of file
......