mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Make customer balance serialize with the currency
This commit is contained in:
@@ -14,7 +14,8 @@ class Api::Admin::CustomerSerializer < ActiveModel::Serializer
|
||||
end
|
||||
|
||||
def balance
|
||||
OpenFoodNetwork::UserBalanceCalculator.new(object.email, object.enterprise).balance
|
||||
balance = OpenFoodNetwork::UserBalanceCalculator.new(object.email, object.enterprise).balance
|
||||
Spree::Money.new(balance, { currency: Spree::Config[:currency] }).to_s
|
||||
end
|
||||
|
||||
def tags
|
||||
|
||||
Reference in New Issue
Block a user