From e1706cc808153992ae109e3aaac231e948f95694 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Sat, 8 Jan 2022 01:56:04 +0300 Subject: [PATCH] added ordering-proxy --- .../Pages/MyOrders.cshtml | 3 +- .../EShopOnAbp.PublicWeb/Pages/myOrders.js | 11 +++++ .../wwwroot/client-proxies/ordering-proxy.js | 47 +++++++++++++++++++ 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/client-proxies/ordering-proxy.js diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/MyOrders.cshtml b/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/MyOrders.cshtml index f07ca16c..ba3799e3 100644 --- a/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/MyOrders.cshtml +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/MyOrders.cshtml @@ -8,6 +8,7 @@ @section scripts { + } @@ -23,7 +24,7 @@ @Model.MyOrders.Count sipariş verildi. - diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/myOrders.js b/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/myOrders.js index b6b81532..c7ba7a01 100644 --- a/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/myOrders.js +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/myOrders.js @@ -15,5 +15,16 @@ abp.notify.success("Added product to your basket.", "Successfully added"); }); }); + + $('#date-filter-selecter').on("change", el => { + const filter = el.target.value; + console.log(filter); + eShopOnAbp.orderingService.orders.order.getMyOrders({ + filter: filter + }).then(res => { + console.log(res); + }); + }) + }); })(); \ No newline at end of file diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/client-proxies/ordering-proxy.js b/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/client-proxies/ordering-proxy.js new file mode 100644 index 00000000..cb2791a7 --- /dev/null +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/wwwroot/client-proxies/ordering-proxy.js @@ -0,0 +1,47 @@ +/* This file is automatically generated by ABP framework to use MVC Controllers from javascript. */ + + +// module ordering + +(function(){ + + // controller eShopOnAbp.orderingService.orders.order + + (function(){ + + abp.utils.createNamespace(window, 'eShopOnAbp.orderingService.orders.order'); + + eShopOnAbp.orderingService.orders.order.get = function(id, ajaxParams) { + return abp.ajax($.extend(true, { + url: abp.appPath + 'api/ordering/order/' + id + '', + type: 'GET' + }, ajaxParams)); + }; + + eShopOnAbp.orderingService.orders.order.getMyOrders = function(input, ajaxParams) { + return abp.ajax($.extend(true, { + url: abp.appPath + 'api/ordering/order/my-orders' + abp.utils.buildQueryString([{ name: 'filter', value: input.filter }]) + '', + type: 'GET' + }, ajaxParams)); + }; + + eShopOnAbp.orderingService.orders.order.getByOrderNo = function(orderNo, ajaxParams) { + return abp.ajax($.extend(true, { + url: abp.appPath + 'api/ordering/order/by-order-no' + abp.utils.buildQueryString([{ name: 'orderNo', value: orderNo }]) + '', + type: 'GET' + }, ajaxParams)); + }; + + eShopOnAbp.orderingService.orders.order.create = function(input, ajaxParams) { + return abp.ajax($.extend(true, { + url: abp.appPath + 'api/ordering/order', + type: 'POST', + data: JSON.stringify(input) + }, ajaxParams)); + }; + + })(); + +})(); + +