daily pastebin goal
66%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. updateTourney: (args, callback) ->
  2.     tourney_id   = args.tourney_id or undefined
  3.     resourceCall = args.resourceCall
  4.     params       = args.params
  5.     data         = args.data or {}
  6.     callback     = callback or ->
  7.  
  8.     tourney = getTourney tourney_id
  9.     if not params.tournament_id?
  10.         params.tournament_id = tourney._id
  11.  
  12.     resource = resourceCall.split('.')[0]
  13.     method = resourceCall.split('.')[1]
  14.  
  15.     $inject.invoke [resource, (resource) ->
  16.         resource.method params, data, (data) ->
  17.             # do something with returned data
  18.     ]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top