Skip to content

Commit

Permalink
Vendor panel - Product Tier price cannot be deleted once start date a…
Browse files Browse the repository at this point in the history
…nd end date is associated #433
  • Loading branch information
support committed Nov 26, 2023
1 parent e003984 commit b669d4f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,17 @@
type: "POST",
dataType: "json",
data: addAntiForgeryToken
},
parameterMap: function (data, operation) {
if (operation === "destroy")
{
return {
id: data.Id,
productId: data.ProductId,
__RequestVerificationToken: data.__RequestVerificationToken
};
}
return data;
}
},
schema: {
Expand Down
2 changes: 1 addition & 1 deletion src/Web/Grand.Web.Vendor/Controllers/ProductController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1783,7 +1783,7 @@ public async Task<IActionResult> TierPriceEditPopup(string productId, ProductMod

[PermissionAuthorizeAction(PermissionActionName.Edit)]
[HttpPost]
public async Task<IActionResult> TierPriceDelete(ProductModel.TierPriceModel model)
public async Task<IActionResult> TierPriceDelete(ProductModel.TierPriceDeleteModel model)
{
if (ModelState.IsValid)
{
Expand Down
5 changes: 5 additions & 0 deletions src/Web/Grand.Web.Vendor/Models/Catalog/ProductModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,11 @@ public TierPriceModel()

}

public class TierPriceDeleteModel : BaseEntityModel, IProductValidVendor
{
public string ProductId { get; set; }
}

public class ProductWarehouseInventoryModel : BaseModel
{
[GrandResourceDisplayName("Vendor.Catalog.Products.ProductWarehouseInventory.Fields.Warehouse")]
Expand Down

0 comments on commit b669d4f

Please sign in to comment.