박권수

feat. bottle register : include dosage register

...@@ -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 }
......