diff --git a/core/api_coupon.go b/core/api_coupon.go index f475a02..74fd4dd 100644 --- a/core/api_coupon.go +++ b/core/api_coupon.go @@ -261,8 +261,8 @@ func listAllCouponNames(mongoClient gocommon.MongoClient, w http.ResponseWriter, } func useCoupon(mongoClient gocommon.MongoClient, w http.ResponseWriter, r *http.Request) { - acc, _ := gocommon.ReadStringFormValue(r.Form, "accid") - if len(acc) == 0 { + acc, ok := gocommon.ReadObjectIDFormValue(r.Form, "accid") + if !ok || acc.IsZero() { w.WriteHeader(http.StatusBadRequest) return }