박권수

fix. gcs upload bug fix

...@@ -41,17 +41,18 @@ exports.uploadQrCode = async ({ directory, qrCodeFileName }) => { ...@@ -41,17 +41,18 @@ exports.uploadQrCode = async ({ directory, qrCodeFileName }) => {
41 const destination = qrCodeFileName; 41 const destination = qrCodeFileName;
42 try { 42 try {
43 //파일을 GCS에 업로드 43 //파일을 GCS에 업로드
44 - const result = await storage.bucket('prescribe-medicine-qrcode').upload(directory + qrCodeFileName, { 44 + const result = await storage.bucket('prescribe-medicine-qrcode').upload(directory + '/' + qrCodeFileName, {
45 destination 45 destination
46 }); 46 });
47 47
48 //업로드 후 파일 삭제 48 //업로드 후 파일 삭제
49 - fs.rm(directory + qrCodeFileName, () => {}); 49 + fs.rm(directory + '/' + qrCodeFileName, () => {});
50 50
51 const qrCodeUrl = GoogleStorageUrl + `${result[0].bucket.id}/${result[0].name}`; 51 const qrCodeUrl = GoogleStorageUrl + `${result[0].bucket.id}/${result[0].name}`;
52 52
53 return qrCodeUrl; 53 return qrCodeUrl;
54 } catch(e) { 54 } catch(e) {
55 + console.log(e);
55 return null; 56 return null;
56 } 57 }
57 }; 58 };
......