Skip to content

Commit 82482bf

Browse files
committed
RE1-T112 PR#324 fixes
1 parent f0b0813 commit 82482bf

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Web/Resgrid.Web/Areas/User/Controllers/SubscriptionController.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,9 @@ public async Task<IActionResult> CancelAddon(int addonTypeId)
687687
[Authorize(Policy = ResgridResources.Department_Update)]
688688
public async Task<IActionResult> GetStripeSession(int id, int count, string discountCode = null, CancellationToken cancellationToken = default)
689689
{
690+
if (count < 1 || count > 200)
691+
return BadRequest("Invalid entity pack count.");
692+
690693
var plan = await _subscriptionsService.GetPlanByIdAsync(id);
691694
var stripeCustomerId = await _departmentSettingsService.GetStripeCustomerIdForDepartmentAsync(DepartmentId);
692695
var department = await _departmentsService.GetDepartmentByIdAsync(DepartmentId);
@@ -725,6 +728,9 @@ public async Task<IActionResult> GetStripeUpdate()
725728
[Authorize(Policy = ResgridResources.Department_Update)]
726729
public async Task<IActionResult> GetPaddleCheckout(int id, int count, string discountCode = null, CancellationToken cancellationToken = default)
727730
{
731+
if (count < 1 || count > 200)
732+
return BadRequest("Invalid entity pack count.");
733+
728734
var plan = await _subscriptionsService.GetPlanByIdAsync(id);
729735
var paddleCustomerId = await _departmentSettingsService.GetPaddleCustomerIdForDepartmentAsync(DepartmentId);
730736
var department = await _departmentsService.GetDepartmentByIdAsync(DepartmentId);

0 commit comments

Comments
 (0)