mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
NOTE: Moved estimatedSubtotal and estimatedTotal functions to the new factory from the subscription line items controller
33 lines
799 B
CoffeeScript
33 lines
799 B
CoffeeScript
angular.module("admin.subscriptions").factory 'SubscriptionResource', ($resource, SubscriptionActions, SubscriptionFunctions) ->
|
|
resource = $resource('/admin/subscriptions/:id/:action.json', {}, {
|
|
'index':
|
|
method: 'GET'
|
|
isArray: true
|
|
'update':
|
|
method: 'PUT'
|
|
params:
|
|
id: '@id'
|
|
'cancel':
|
|
method: 'PUT'
|
|
params:
|
|
id: '@id'
|
|
action: 'cancel'
|
|
open_orders: '@open_orders'
|
|
'pause':
|
|
method: 'PUT'
|
|
params:
|
|
id: '@id'
|
|
action: 'pause'
|
|
open_orders: '@open_orders'
|
|
'unpause':
|
|
method: 'PUT'
|
|
params:
|
|
id: '@id'
|
|
action: 'unpause'
|
|
})
|
|
|
|
angular.extend(resource.prototype, SubscriptionActions)
|
|
angular.extend(resource.prototype, SubscriptionFunctions)
|
|
|
|
resource
|