Showing
1 changed file
with
2 additions
and
3 deletions
... | @@ -4,7 +4,6 @@ const Hub = require('../../models/hub'); | ... | @@ -4,7 +4,6 @@ const Hub = require('../../models/hub'); |
4 | const Medicine = require('../../models/medicine'); | 4 | const Medicine = require('../../models/medicine'); |
5 | const Mqtt = require('../../lib/MqttModule'); | 5 | const Mqtt = require('../../lib/MqttModule'); |
6 | const jwt = require('jsonwebtoken'); | 6 | const jwt = require('jsonwebtoken'); |
7 | -const { createIndexes } = require('../../models/bottle'); | ||
8 | 7 | ||
9 | //약병 등록 | 8 | //약병 등록 |
10 | exports.bottleConnect = async(ctx) => { | 9 | exports.bottleConnect = async(ctx) => { |
... | @@ -106,7 +105,7 @@ exports.lookupInfo = async(ctx) => { | ... | @@ -106,7 +105,7 @@ exports.lookupInfo = async(ctx) => { |
106 | return; | 105 | return; |
107 | } | 106 | } |
108 | 107 | ||
109 | - const hub = await Hub.findByHubId(bottle.getHubId()); | 108 | + const hub = await Hub.findByHubId(isBottleExist.getHubId()); |
110 | if(hub.getHub_UserId() !== userId) { | 109 | if(hub.getHub_UserId() !== userId) { |
111 | ctx.status = 403; | 110 | ctx.status = 403; |
112 | return; | 111 | return; |
... | @@ -159,7 +158,7 @@ exports.setMedicine = async(ctx) => { | ... | @@ -159,7 +158,7 @@ exports.setMedicine = async(ctx) => { |
159 | bottleId | 158 | bottleId |
160 | }, { | 159 | }, { |
161 | medicineId, | 160 | medicineId, |
162 | - dosage | 161 | + dosage : parseInt(dosage) |
163 | }); | 162 | }); |
164 | 163 | ||
165 | ctx.status = 200; | 164 | ctx.status = 200; | ... | ... |
-
Please register or login to post a comment