public async Task <IActionResult> DeleteIntegration(int id, [FromServices] OAuthPostgres oauthdb)
        {
            var username = HttpContext.User.Identity.Name;

            await oauthdb.DeleteByID(id, username);

            return(Ok());
        }
Пример #2
0
 //Setup this class as a Scoped dependency injection and call SetupScope
 public ShopifyService(IHttpService http, IApplicationCache cache,
                       ShopifyOAuth oauth, OAuthPostgres oauthDb, OAuthService oauthRetriever, IRavenClient raven, IOptions <ShopifyOptions> config)
 {
     this.http           = http;
     this.raven          = raven;
     this.config         = config.Value;
     this.oauthDb        = oauthDb;
     this.cache          = cache;
     this.oauthRetriever = oauthRetriever;
 }
Пример #3
0
 public DropshippingService(ShopifyService shopify, ISearchService search, OAuthPostgres dbOauth,
                            OAuthService oauthdb, DropshipItemsPostgres dbItems, DropshipAccountsPostgres dbAccounts, IApplicationCache cache)
 {
     this.shopify    = shopify;
     this.search     = search;
     this.dbItems    = dbItems;
     this.dbAccounts = dbAccounts;
     this.cache      = cache;
     this.dbOAuth    = dbOauth;
     this.oauthdb    = oauthdb;
 }
        public async Task <IActionResult> GetIntegrations([FromServices] OAuthPostgres oauthdb)
        {
            var username = "******";

            if (HttpContext.User.Identity.IsAuthenticated)
            {
                username = HttpContext.User.Identity.Name;
            }

            var integrations = await dropship.GetIntegrations(username);

            return(Json(integrations));
        }
Пример #5
0
 public OAuthService(OAuthPostgres db)
 {
     this.db = db;
 }