@ -261,8 +261,8 @@ func listAllCouponNames(mongoClient gocommon.MongoClient, w http.ResponseWriter,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func useCoupon(mongoClient gocommon.MongoClient, w http.ResponseWriter, r *http.Request) {
|
func useCoupon(mongoClient gocommon.MongoClient, w http.ResponseWriter, r *http.Request) {
|
||||||
acc, _ := gocommon.ReadStringFormValue(r.Form, "accid")
|
acc, ok := gocommon.ReadObjectIDFormValue(r.Form, "accid")
|
||||||
if len(acc) == 0 {
|
if !ok || acc.IsZero() {
|
||||||
w.WriteHeader(http.StatusBadRequest)
|
w.WriteHeader(http.StatusBadRequest)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user