How to use the card.consumers function in card

To help you get started, we’ve selected a few card examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yapplabs / glazier / cards / github-repositories / app / routes / application.js View on Github external
model: function(){
    return card.consumers.authenticatedGithubApi.getRepositories();
  }
});
github yapplabs / glazier / cards / github-issues / app / models / issue.js View on Github external
findByRepositoryNameAndGithubLogin: function(repositoryName, githubLogin) {
    return card.consumers.authenticatedGithubApi.request("ajax", {
      url: '/repos/' + repositoryName + '/issues?creator=' + githubLogin,
      dataType: 'json'
    });
  },
github yapplabs / glazier / cards / github-issues / app / models / issue.js View on Github external
findAllByRepositoryName: function(repositoryName) {
    var service;

    if (card.data.user) {
      service = card.consumers.authenticatedGithubApi;
    } else {
      service = card.consumers.unauthenticatedGithubApi;
    }

    return service.request("ajax", {
      url: '/repos/' + repositoryName + '/issues',
      dataType: 'json'
    });
  },
github yapplabs / glazier / cards / github-stars / app / routes / application.js View on Github external
getApiConsumer: function(user){
    return user ? card.consumers.authenticatedGithubApi : card.consumers.unauthenticatedGithubApi;
  },
  findByRepositoryName: function(repositoryName, user) {