mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-17 06:52:27 +01:00
price cache
This commit is contained in:
parent
4d0d3d6af0
commit
85a40db603
@ -8,7 +8,7 @@ Application.Controllers.controller "EditPricingController", ["$scope", "$state",
|
||||
|
||||
### PUBLIC SCOPE ###
|
||||
## List of machines prices (not considering any plan)
|
||||
$scope.machinesPrices = machinesPricesPromise.prices
|
||||
$scope.machinesPrices = machinesPricesPromise
|
||||
|
||||
## List of trainings pricing
|
||||
$scope.trainingsPricings = trainingsPricingsPromise
|
||||
|
@ -4,7 +4,7 @@ Application.Services.factory 'Price', ["$resource", ($resource)->
|
||||
$resource "/api/prices/:id",
|
||||
{},
|
||||
query:
|
||||
isArray: false
|
||||
isArray: true
|
||||
update:
|
||||
method: 'PUT'
|
||||
compute:
|
||||
|
@ -2,7 +2,7 @@ class API::TrainingsPricingsController < API::ApiController
|
||||
before_action :authenticate_user!
|
||||
|
||||
def index
|
||||
@trainings_pricings = TrainingsPricing.includes(:training)
|
||||
@trainings_pricings = TrainingsPricing.all
|
||||
end
|
||||
|
||||
def update
|
||||
|
@ -1,3 +1,2 @@
|
||||
json.extract! price, :id, :group_id, :plan_id, :priceable_type, :priceable_id
|
||||
json.amount price.amount / 100.0
|
||||
json.priceable_name price.priceable.name
|
||||
|
@ -1,3 +1,3 @@
|
||||
json.cache! @prices do
|
||||
json.prices @prices, partial: 'api/prices/price', as: :price
|
||||
json.partial! 'api/prices/price', collection: @prices, as: :price
|
||||
end
|
||||
|
@ -1,5 +1,2 @@
|
||||
json.extract! trainings_pricing, :id, :group_id, :training_id
|
||||
json.amount trainings_pricing.amount / 100.0
|
||||
json.training do
|
||||
json.name trainings_pricing.training.name
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user