Use .all convention for shipping and payment methods resource services

This commit is contained in:
Rob Harrington
2018-02-19 13:46:09 +11:00
committed by Rob H
parent 8951c79f71
commit 3ac57269ed
6 changed files with 16 additions and 16 deletions

View File

@@ -1,7 +1,7 @@
angular.module("admin.enterprises")
.factory "EnterprisePaymentMethods", (enterprise, PaymentMethods) ->
new class EnterprisePaymentMethods
paymentMethods: PaymentMethods.paymentMethods
paymentMethods: PaymentMethods.all
constructor: ->
for payment_method in @paymentMethods

View File

@@ -1,7 +1,7 @@
angular.module("admin.enterprises")
.factory "EnterpriseShippingMethods", (enterprise, ShippingMethods) ->
new class EnterpriseShippingMethods
shippingMethods: ShippingMethods.shippingMethods
shippingMethods: ShippingMethods.all
constructor: ->
for shipping_method in @shippingMethods

View File

@@ -1,7 +1,7 @@
angular.module("admin.resources")
.factory "PaymentMethods", ($injector) ->
new class PaymentMethods
paymentMethods: []
all: []
byID: {}
pristineByID: {}
@@ -11,6 +11,6 @@ angular.module("admin.resources")
load: (paymentMethods) ->
for paymentMethod in paymentMethods
@paymentMethods.push paymentMethod
@all.push paymentMethod
@byID[paymentMethod.id] = paymentMethod
@pristineByID[paymentMethod.id] = angular.copy(paymentMethod)

View File

@@ -1,7 +1,7 @@
angular.module("admin.resources")
.factory "ShippingMethods", ($injector) ->
new class ShippingMethods
shippingMethods: []
all: []
byID: {}
pristineByID: {}
@@ -11,6 +11,6 @@ angular.module("admin.resources")
load: (shippingMethods) ->
for shippingMethod in shippingMethods
@shippingMethods.push shippingMethod
@all.push shippingMethod
@byID[shippingMethod.id] = shippingMethod
@pristineByID[shippingMethod.id] = angular.copy(shippingMethod)