mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-03 22:06:07 +00:00
Merge pull request #4578 from kshlyk/remove_soft_delete_from_product_and_variant_api
Removing duplicate API method soft_delete for both products and variants
This commit is contained in:
@@ -741,7 +741,7 @@ describe "AdminProductEditCtrl", ->
|
||||
|
||||
|
||||
describe "deleting products", ->
|
||||
it "deletes products with a http delete request to /api/products/id/soft_delete", ->
|
||||
it "deletes products with a http delete request to /api/products/id", ->
|
||||
spyOn(window, "confirm").and.returnValue true
|
||||
$scope.products = [
|
||||
{
|
||||
@@ -754,7 +754,7 @@ describe "AdminProductEditCtrl", ->
|
||||
}
|
||||
]
|
||||
$scope.dirtyProducts = {}
|
||||
$httpBackend.expectDELETE("/api/products/13/soft_delete").respond 200, "data"
|
||||
$httpBackend.expectDELETE("/api/products/13").respond 200, "data"
|
||||
$scope.deleteProduct $scope.products[1]
|
||||
$httpBackend.flush()
|
||||
|
||||
@@ -773,7 +773,7 @@ describe "AdminProductEditCtrl", ->
|
||||
DirtyProducts.addProductProperty 9, "someProperty", "something"
|
||||
DirtyProducts.addProductProperty 13, "name", "P1"
|
||||
|
||||
$httpBackend.expectDELETE("/api/products/13/soft_delete").respond 200, "data"
|
||||
$httpBackend.expectDELETE("/api/products/13").respond 200, "data"
|
||||
$scope.deleteProduct $scope.products[1]
|
||||
$httpBackend.flush()
|
||||
expect($scope.products).toEqual [
|
||||
@@ -813,7 +813,7 @@ describe "AdminProductEditCtrl", ->
|
||||
|
||||
|
||||
describe "when the variant has been saved", ->
|
||||
it "deletes variants with a http delete request to /api/products/product_permalink/variants/(variant_id)/soft_delete", ->
|
||||
it "deletes variants with a http delete request to /api/products/product_permalink/variants/(variant_id)", ->
|
||||
spyOn(window, "confirm").and.returnValue true
|
||||
$scope.products = [
|
||||
{
|
||||
@@ -835,7 +835,7 @@ describe "AdminProductEditCtrl", ->
|
||||
}
|
||||
]
|
||||
$scope.dirtyProducts = {}
|
||||
$httpBackend.expectDELETE("/api/products/apples/variants/3/soft_delete").respond 200, "data"
|
||||
$httpBackend.expectDELETE("/api/products/apples/variants/3").respond 200, "data"
|
||||
$scope.deleteVariant $scope.products[0], $scope.products[0].variants[0]
|
||||
$httpBackend.flush()
|
||||
|
||||
@@ -865,7 +865,7 @@ describe "AdminProductEditCtrl", ->
|
||||
DirtyProducts.addVariantProperty 9, 4, "price", 6.0
|
||||
DirtyProducts.addProductProperty 13, "name", "P1"
|
||||
|
||||
$httpBackend.expectDELETE("/api/products/apples/variants/3/soft_delete").respond 200, "data"
|
||||
$httpBackend.expectDELETE("/api/products/apples/variants/3").respond 200, "data"
|
||||
$scope.deleteVariant $scope.products[0], $scope.products[0].variants[0]
|
||||
$httpBackend.flush()
|
||||
expect($scope.products[0].variants).toEqual [
|
||||
|
||||
Reference in New Issue
Block a user