mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-09-24 16:05:44 +08:00
fix(plans): require price > 0 for subscription plans
This commit is contained in:
@@ -1 +1 @@
|
||||
0.1.110.35
|
||||
0.1.110.36
|
||||
|
||||
@@ -19,8 +19,8 @@ func validatePlanRequired(name string, groupID int64, price float64, validityDay
|
||||
if groupID <= 0 {
|
||||
return infraerrors.BadRequest("PLAN_GROUP_REQUIRED", "group is required")
|
||||
}
|
||||
if price < 0 {
|
||||
return infraerrors.BadRequest("PLAN_PRICE_INVALID", "price must be >= 0")
|
||||
if price <= 0 {
|
||||
return infraerrors.BadRequest("PLAN_PRICE_INVALID", "price must be > 0")
|
||||
}
|
||||
if validityDays <= 0 {
|
||||
return infraerrors.BadRequest("PLAN_VALIDITY_REQUIRED", "validity days must be > 0")
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
|
||||
<div><label class="input-label">{{ t('payment.admin.planDescription') }} <span class="text-red-500">*</span></label><textarea v-model="planForm.description" rows="2" class="input" required></textarea></div>
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div><label class="input-label">{{ t('payment.admin.price') }} <span class="text-red-500">*</span></label><input v-model.number="planForm.price" type="number" step="0.01" min="0" class="input" required /></div>
|
||||
<div><label class="input-label">{{ t('payment.admin.price') }} <span class="text-red-500">*</span></label><input v-model.number="planForm.price" type="number" step="0.01" min="0.01" class="input" required /></div>
|
||||
<div><label class="input-label">{{ t('payment.admin.originalPrice') }}</label><input v-model.number="planForm.original_price" type="number" step="0.01" min="0" class="input" /></div>
|
||||
</div>
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
|
||||
Reference in New Issue
Block a user