mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-06 02:51:34 +00:00
Remove derived attributes from master variant
This commit is contained in:
@@ -401,6 +401,9 @@ productEditModule.controller "AdminProductEditCtrl", [
|
||||
delete variant.unit_value_with_description
|
||||
# If we end up live-updating this field, we might want to reinstate its verification here
|
||||
delete variant.options_text
|
||||
if product.master
|
||||
delete product.master.unit_value_with_description
|
||||
delete product.master.options_text
|
||||
products_filtered
|
||||
|
||||
|
||||
|
||||
@@ -850,6 +850,15 @@ describe "AdminProductEditCtrl", ->
|
||||
}
|
||||
]
|
||||
|
||||
it "returns master variant without the unit_value_with_description field", ->
|
||||
scope.products = [{id: 123, master: {id: 234, unit_value_with_description: 'foo'}}]
|
||||
expect(scope.productsWithoutDerivedAttributes(scope.products)).toEqual [
|
||||
{
|
||||
id: 123
|
||||
master: {id: 234}
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
describe "deep copying products", ->
|
||||
it "copies products", ->
|
||||
|
||||
Reference in New Issue
Block a user