JD2022-TU1/data/EngineData/JustDanceTools/app/projects/projects.collection.coffee

22 lines
513 B
CoffeeScript

Backbone = require 'backbone'
Model = require './projects.model.coffee'
Radio = require 'backbone.radio'
class ProjectsCollection extends Backbone.Collection
constructor: ( ) ->
super()
model: Model
sync: ( method, model, options ) ->
SG = Radio.channel('app').request('getShotgun')
SG.getProjects()
.then ( data ) ->
options.success(data, true, undefined)
.catch ( err ) ->
options.error(err)
module.exports = ProjectsCollection