mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-04 22:16:08 +00:00
return empty string for unitName if no scale matches
This commit is contained in:
@@ -48,7 +48,10 @@ angular.module("admin.products").factory "VariantUnitManager", ->
|
||||
unitScales[0]
|
||||
|
||||
@getUnitName: (scale, unitType) ->
|
||||
@units[unitType][scale]['name']
|
||||
if @units[unitType][scale]
|
||||
@units[unitType][scale]['name']
|
||||
else
|
||||
''
|
||||
|
||||
@unitScales: (unitType) ->
|
||||
(parseFloat(scale) for scale in Object.keys(@units[unitType])).sort (a, b) ->
|
||||
|
||||
Reference in New Issue
Block a user