diff --git a/core/api_coupon.go b/core/api_coupon.go index 18bda65..f475a02 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, ok := gocommon.ReadObjectIDFormValue(r.Form, "accid") - if !ok || acc.IsZero() { + acc, _ := gocommon.ReadStringFormValue(r.Form, "accid") + if len(acc) == 0 { w.WriteHeader(http.StatusBadRequest) return } @@ -285,7 +285,7 @@ func useCoupon(mongoClient gocommon.MongoClient, w http.ResponseWriter, r *http. // 무한 쿠폰일 수 있으므로 존재하는지 확인 if err := mongoClient.FindOneAs(CollectionCoupon, bson.M{ "_id": roundObj, - }, &coupon, options.FindOne().SetProjection(bson.M{"_id": 0, "effect": 1, "name": 1, "reason": 1, "total": 1, "expire": 1})); err != nil { + }, &coupon, options.FindOne().SetProjection(bson.M{"_id": 0, "effect": 1, "name": 1, "total": 1, "expire": 1})); err != nil { logger.Println(err) w.WriteHeader(http.StatusInternalServerError) return