@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user