Showing
1 changed file
with
1 additions
and
1 deletions
| ... | @@ -86,7 +86,7 @@ const transPublishingTopicAndMessage = async(bottleId) => { | ... | @@ -86,7 +86,7 @@ const transPublishingTopicAndMessage = async(bottleId) => { |
| 86 | const bottleMedicine = await BottleMedicine.findOne({ bottleId, useYn : 'Y' }); | 86 | const bottleMedicine = await BottleMedicine.findOne({ bottleId, useYn : 'Y' }); |
| 87 | const takeMedicineHist = await TakeMedicineHist.find({ | 87 | const takeMedicineHist = await TakeMedicineHist.find({ |
| 88 | bmId : bottleMedicine._id | 88 | bmId : bottleMedicine._id |
| 89 | - }).sort((a, b) => a.takeDate < b.takeDate)[0]; | 89 | + }).sort({ takeDate : 'asc' })[0]; |
| 90 | 90 | ||
| 91 | const message = 'res/' + await transDate(takeMedicineHist.takeDate) + '/' + bottleMedicine.dosage; | 91 | const message = 'res/' + await transDate(takeMedicineHist.takeDate) + '/' + bottleMedicine.dosage; |
| 92 | 92 | ... | ... |
-
Please register or login to post a comment