Showing
1 changed file
with
6 additions
and
4 deletions
| ... | @@ -21,11 +21,13 @@ exports.medicineSearch = async(ctx) => { | ... | @@ -21,11 +21,13 @@ exports.medicineSearch = async(ctx) => { |
| 21 | else if (target && target !== '' && target !== undefined) | 21 | else if (target && target !== '' && target !== undefined) |
| 22 | result = await medicineSearch_ByTarget(target); | 22 | result = await medicineSearch_ByTarget(target); |
| 23 | 23 | ||
| 24 | - ctx.status = 200; | 24 | + if(!result.length) { |
| 25 | - ctx.body = { | 25 | + ctx.status = 404; |
| 26 | - totalItem : result.length, | 26 | + return; |
| 27 | - result | ||
| 28 | } | 27 | } |
| 28 | + | ||
| 29 | + ctx.status = 200; | ||
| 30 | + ctx.body = result; | ||
| 29 | } | 31 | } |
| 30 | 32 | ||
| 31 | exports.medicineGet = async(ctx) => { | 33 | exports.medicineGet = async(ctx) => { | ... | ... |
-
Please register or login to post a comment