mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Client-side, always show properties by their presentation, not their name
This commit is contained in:
@@ -45,7 +45,7 @@ module InjectionHelper
|
||||
end
|
||||
|
||||
def inject_properties
|
||||
inject_json_ams "properties", Spree::Property.all, Api::IdNameSerializer
|
||||
inject_json_ams "properties", Spree::Property.all, Api::PropertySerializer
|
||||
end
|
||||
|
||||
def inject_currency_config
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
class Api::PropertySerializer < ActiveModel::Serializer
|
||||
attributes :id, :name, :presentation
|
||||
|
||||
# Client-side we don't care about the property name. Send the presentation
|
||||
# since this is what we want to show to the user.
|
||||
def name
|
||||
object.presentation
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user