import Service from 'ember-service';
import injectService from 'ember-service/inject';

/*
  Twitch Prime Subscription Credit Service
 */
export default Service.extend({
  api: injectService(),
  // TODO - cache the balance call here
  spendCredit(channel) {
    return this.get('api').request('post', '/api/premium/credit/spend', { channel_id: channel.get('id') });
    // TODO modify the channel state from here
  }
});
