Showing
1 changed file
with
5 additions
and
2 deletions
... | @@ -132,7 +132,7 @@ exports.setMedicine = async(ctx) => { | ... | @@ -132,7 +132,7 @@ exports.setMedicine = async(ctx) => { |
132 | 132 | ||
133 | const { userId } = jwt.verify(token, process.env.JWT_SECRET); | 133 | const { userId } = jwt.verify(token, process.env.JWT_SECRET); |
134 | const { bottleId } = ctx.params; | 134 | const { bottleId } = ctx.params; |
135 | - const { medicineId } = ctx.request.body; | 135 | + const { medicineId, dosage } = ctx.request.body; |
136 | 136 | ||
137 | const bottle = await Bottle.findByBottleId(bottleId); | 137 | const bottle = await Bottle.findByBottleId(bottleId); |
138 | if(!bottle) { | 138 | if(!bottle) { |
... | @@ -154,7 +154,10 @@ exports.setMedicine = async(ctx) => { | ... | @@ -154,7 +154,10 @@ exports.setMedicine = async(ctx) => { |
154 | 154 | ||
155 | await Bottle.findOneAndUpdate({ | 155 | await Bottle.findOneAndUpdate({ |
156 | bottleId | 156 | bottleId |
157 | - }, { medicineId }); | 157 | + }, { |
158 | + medicineId, | ||
159 | + dosage | ||
160 | + }); | ||
158 | 161 | ||
159 | ctx.status = 200; | 162 | ctx.status = 200; |
160 | } | 163 | } | ... | ... |
-
Please register or login to post a comment